Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,11 +116,16 @@ def process_request(input_text):
|
|
| 116 |
# Return the translations and contexts
|
| 117 |
return translations, context_results
|
| 118 |
|
| 119 |
-
# Gradio interface
|
| 120 |
def gradio_interface(input_text):
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
return output.strip()
|
| 125 |
|
| 126 |
# Create the Gradio interface
|
|
|
|
| 116 |
# Return the translations and contexts
|
| 117 |
return translations, context_results
|
| 118 |
|
|
|
|
| 119 |
def gradio_interface(input_text):
|
| 120 |
+
# Call process_request to get translations and context_results
|
| 121 |
+
translations, contexts = process_request(input_text)
|
| 122 |
+
|
| 123 |
+
# Extract only the translation values from the dictionary
|
| 124 |
+
translation_values = list(translations.values())
|
| 125 |
+
|
| 126 |
+
# Join the translations into a single string with line breaks
|
| 127 |
+
output = "\n".join(translation_values)
|
| 128 |
+
|
| 129 |
return output.strip()
|
| 130 |
|
| 131 |
# Create the Gradio interface
|