Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ iso1_to_name = {iso[1]: iso[0] for iso in non_empty_isos} # {'ro': 'Romanian', '
|
|
| 18 |
langs = list(favourite_langs.keys())
|
| 19 |
langs.extend(list(all_langs.keys())) # Language options as list, add favourite languages first
|
| 20 |
|
| 21 |
-
models = ["Helsinki-NLP", "
|
| 22 |
"Helsinki-NLP/opus-mt-tc-bible-big-mul-mul", "Helsinki-NLP/opus-mt-tc-bible-big-mul-deu_eng_nld",
|
| 23 |
"Helsinki-NLP/opus-mt-tc-bible-big-mul-deu_eng_fra_por_spa", "Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-mul",
|
| 24 |
"Helsinki-NLP/opus-mt-tc-bible-big-roa-deu_eng_fra_por_spa", "Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa", "Helsinki-NLP/opus-mt-tc-bible-big-roa-en"
|
|
@@ -479,7 +479,7 @@ def translate_text(input_text: str, s_language: str, t_language: str, model_name
|
|
| 479 |
elif model_name == 'Argos':
|
| 480 |
translated_text = Translators(model_name, sl, tl, input_text).argos()
|
| 481 |
|
| 482 |
-
elif model_name == "
|
| 483 |
translated_text, message_text = Translators(model_name, sl, tl, input_text).quickmt()
|
| 484 |
|
| 485 |
elif model_name == 'Google':
|
|
@@ -566,6 +566,8 @@ def get_info(model_name: str, sl: str = None, tl: str = None):
|
|
| 566 |
return response
|
| 567 |
elif model_name == "Argos":
|
| 568 |
return httpx.get(f'https://huggingface.co/TiberiuCristianLeon/Argostranslate/raw/main/README.md').text
|
|
|
|
|
|
|
| 569 |
elif model_name == "Google":
|
| 570 |
return "Google Translate Online"
|
| 571 |
else:
|
|
|
|
| 18 |
langs = list(favourite_langs.keys())
|
| 19 |
langs.extend(list(all_langs.keys())) # Language options as list, add favourite languages first
|
| 20 |
|
| 21 |
+
models = ["Helsinki-NLP", "QUICKMT", "Argos", "Google", "HPLT", "HPLT-OPUS",
|
| 22 |
"Helsinki-NLP/opus-mt-tc-bible-big-mul-mul", "Helsinki-NLP/opus-mt-tc-bible-big-mul-deu_eng_nld",
|
| 23 |
"Helsinki-NLP/opus-mt-tc-bible-big-mul-deu_eng_fra_por_spa", "Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-mul",
|
| 24 |
"Helsinki-NLP/opus-mt-tc-bible-big-roa-deu_eng_fra_por_spa", "Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa", "Helsinki-NLP/opus-mt-tc-bible-big-roa-en"
|
|
|
|
| 479 |
elif model_name == 'Argos':
|
| 480 |
translated_text = Translators(model_name, sl, tl, input_text).argos()
|
| 481 |
|
| 482 |
+
elif model_name == "QUICKMT":
|
| 483 |
translated_text, message_text = Translators(model_name, sl, tl, input_text).quickmt()
|
| 484 |
|
| 485 |
elif model_name == 'Google':
|
|
|
|
| 566 |
return response
|
| 567 |
elif model_name == "Argos":
|
| 568 |
return httpx.get(f'https://huggingface.co/TiberiuCristianLeon/Argostranslate/raw/main/README.md').text
|
| 569 |
+
elif "HPLT" in model_name:
|
| 570 |
+
return '[HPLT Uni direction translation models](https://huggingface.co/collections/HPLT/hplt-12-uni-direction-translation-models)'
|
| 571 |
elif model_name == "Google":
|
| 572 |
return "Google Translate Online"
|
| 573 |
else:
|