Add Rosetta 4b
Browse files
app.py
CHANGED
|
@@ -237,7 +237,7 @@ class Translators:
|
|
| 237 |
def simplepipe(self):
|
| 238 |
try:
|
| 239 |
pipe = pipeline("translation", model=self.model_name, device=self.device)
|
| 240 |
-
translation = pipe(self.input_text,
|
| 241 |
message = f'Translated from {iso1toall[self.sl][0]} to {iso1toall[self.tl][0]} with {self.model_name}.'
|
| 242 |
return translation[0]['translation_text'], message
|
| 243 |
except Exception as error:
|
|
|
|
| 237 |
def simplepipe(self):
|
| 238 |
try:
|
| 239 |
pipe = pipeline("translation", model=self.model_name, device=self.device)
|
| 240 |
+
translation = pipe(self.input_text, src_lang=self.sl, tgt_lang=self.tl)
|
| 241 |
message = f'Translated from {iso1toall[self.sl][0]} to {iso1toall[self.tl][0]} with {self.model_name}.'
|
| 242 |
return translation[0]['translation_text'], message
|
| 243 |
except Exception as error:
|