Spaces:
Running
Running
Update src/Translate.py
Browse files- src/Translate.py +2 -2
src/Translate.py
CHANGED
|
@@ -32,10 +32,10 @@ class Translators:
|
|
| 32 |
return f"Error translating with model: {self.model_name}! Try other available language combination.", error
|
| 33 |
def text2textgenerationpipe(self):
|
| 34 |
translation = pipeline('text2text-generation', model = self.model_name)
|
| 35 |
-
return translation(
|
| 36 |
def translationpipe(self):
|
| 37 |
translation = pipeline('translation', model = self.model_name)
|
| 38 |
-
return translation(
|
| 39 |
|
| 40 |
def paraphraseTranslateMethod(requestValue: str, model: str):
|
| 41 |
nltk.download('punkt')
|
|
|
|
| 32 |
return f"Error translating with model: {self.model_name}! Try other available language combination.", error
|
| 33 |
def text2textgenerationpipe(self):
|
| 34 |
translation = pipeline('text2text-generation', model = self.model_name)
|
| 35 |
+
return translation(self.input_text)[0]['generated_text'], self.message
|
| 36 |
def translationpipe(self):
|
| 37 |
translation = pipeline('translation', model = self.model_name)
|
| 38 |
+
return translation(self.input_text)[0]['translation_text'], self.message
|
| 39 |
|
| 40 |
def paraphraseTranslateMethod(requestValue: str, model: str):
|
| 41 |
nltk.download('punkt')
|