Update app.py
Browse files
app.py
CHANGED
|
@@ -47,7 +47,7 @@ models = ["Helsinki-NLP", "QUICKMT", "Argos", "Lego-MT/Lego-MT", "HPLT", "HPLT-O
|
|
| 47 |
"BSC-LT/salamandraTA-2b-instruct", "BSC-LT/salamandraTA-7b-instruct",
|
| 48 |
"utter-project/EuroLLM-1.7B", "utter-project/EuroLLM-1.7B-Instruct",
|
| 49 |
"Unbabel/Tower-Plus-2B", "Unbabel/TowerInstruct-7B-v0.2", "Unbabel/TowerInstruct-Mistral-7B-v0.2",
|
| 50 |
-
"HuggingFaceTB/SmolLM3-3B",
|
| 51 |
"winninghealth/WiNGPT-Babel-2-1", "winninghealth/WiNGPT-Babel-2", "winninghealth/WiNGPT-Babel",
|
| 52 |
"tencent/Hunyuan-MT-7B",
|
| 53 |
"openGPT-X/Teuken-7B-instruct-commercial-v0.4", "openGPT-X/Teuken-7B-instruct-v0.6",
|
|
@@ -213,7 +213,7 @@ class Translators:
|
|
| 213 |
|
| 214 |
def salamandratapipe(self):
|
| 215 |
pipe = pipeline("text-generation", model=self.model_name)
|
| 216 |
-
messages = [f"Translate the following text from {self.sl} into {self.tl}.\n{self.sl}: {self.input_text} \n{self.tl}:"]
|
| 217 |
return pipe(messages)[0]["generated_text"]
|
| 218 |
|
| 219 |
def salamandrata(self):
|
|
@@ -609,7 +609,7 @@ def translate_text(model_name: str, s_language: str, t_language: str, input_text
|
|
| 609 |
translated_text = Translators(model_name, sl, tl, input_text).google()
|
| 610 |
|
| 611 |
elif "salamandra" in model_name.lower():
|
| 612 |
-
translated_text = Translators(model_name, s_language, t_language, input_text).
|
| 613 |
|
| 614 |
elif "m2m" in model_name.lower():
|
| 615 |
translated_text = Translators(model_name, sl, tl, input_text).mtom()
|
|
|
|
| 47 |
"BSC-LT/salamandraTA-2b-instruct", "BSC-LT/salamandraTA-7b-instruct",
|
| 48 |
"utter-project/EuroLLM-1.7B", "utter-project/EuroLLM-1.7B-Instruct",
|
| 49 |
"Unbabel/Tower-Plus-2B", "Unbabel/TowerInstruct-7B-v0.2", "Unbabel/TowerInstruct-Mistral-7B-v0.2",
|
| 50 |
+
"HuggingFaceTB/SmolLM3-3B", "LLaMAX/LLaMAX3-8B",
|
| 51 |
"winninghealth/WiNGPT-Babel-2-1", "winninghealth/WiNGPT-Babel-2", "winninghealth/WiNGPT-Babel",
|
| 52 |
"tencent/Hunyuan-MT-7B",
|
| 53 |
"openGPT-X/Teuken-7B-instruct-commercial-v0.4", "openGPT-X/Teuken-7B-instruct-v0.6",
|
|
|
|
| 213 |
|
| 214 |
def salamandratapipe(self):
|
| 215 |
pipe = pipeline("text-generation", model=self.model_name)
|
| 216 |
+
messages = [{"role": "user", "content": f"Translate the following text from {self.sl} into {self.tl}.\n{self.sl}: {self.input_text} \n{self.tl}:"}]
|
| 217 |
return pipe(messages)[0]["generated_text"]
|
| 218 |
|
| 219 |
def salamandrata(self):
|
|
|
|
| 609 |
translated_text = Translators(model_name, sl, tl, input_text).google()
|
| 610 |
|
| 611 |
elif "salamandra" in model_name.lower():
|
| 612 |
+
translated_text = Translators(model_name, s_language, t_language, input_text).salamandratapipe()
|
| 613 |
|
| 614 |
elif "m2m" in model_name.lower():
|
| 615 |
translated_text = Translators(model_name, sl, tl, input_text).mtom()
|