Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ def nllb(model_name, sl, tl, input_text):
|
|
| 104 |
return translated_text[0]['translation_text']
|
| 105 |
|
| 106 |
@spaces.GPU
|
| 107 |
-
def translate_text(input_text: str, sselected_language: str, tselected_language: str, model_name: str) -> str:
|
| 108 |
"""
|
| 109 |
Translates the input text from the source language to the target language using a specified model.
|
| 110 |
|
|
@@ -117,7 +117,7 @@ def translate_text(input_text: str, sselected_language: str, tselected_language:
|
|
| 117 |
Returns:
|
| 118 |
tuple:
|
| 119 |
translated_text(str): The input text translated to the selected target language
|
| 120 |
-
message_text(str): A descriptive message summarizing the translation process. Example: "Translated from English to
|
| 121 |
|
| 122 |
Example:
|
| 123 |
>>> translate_text("Hello world", "English", "German", "Helsinki-NLP")
|
|
|
|
| 104 |
return translated_text[0]['translation_text']
|
| 105 |
|
| 106 |
@spaces.GPU
|
| 107 |
+
def translate_text(input_text: str, sselected_language: str, tselected_language: str, model_name: str) -> tuple[str, str]:
|
| 108 |
"""
|
| 109 |
Translates the input text from the source language to the target language using a specified model.
|
| 110 |
|
|
|
|
| 117 |
Returns:
|
| 118 |
tuple:
|
| 119 |
translated_text(str): The input text translated to the selected target language
|
| 120 |
+
message_text(str): A descriptive message summarizing the translation process. Example: "Translated from English to German with Helsinki-NLP."
|
| 121 |
|
| 122 |
Example:
|
| 123 |
>>> translate_text("Hello world", "English", "German", "Helsinki-NLP")
|