Update app.py
Browse files
app.py
CHANGED
|
@@ -58,6 +58,7 @@ class Translators:
|
|
| 58 |
translation = pipe(self.input_text)
|
| 59 |
return translation[0]['translation_text']
|
| 60 |
|
|
|
|
| 61 |
def quickmttranslate(model_path, input_text):
|
| 62 |
from quickmt import Translator
|
| 63 |
# 'auto' auto-detects GPU, set to "cpu" to force CPU inference
|
|
@@ -68,6 +69,7 @@ class Translators:
|
|
| 68 |
translation = translator(input_text, beam_size=5)[0]
|
| 69 |
return translation
|
| 70 |
|
|
|
|
| 71 |
def quickmtdownload(model_name):
|
| 72 |
from pathlib import Path
|
| 73 |
model_path = Path("/quickmt/models") / model_name
|
|
|
|
| 58 |
translation = pipe(self.input_text)
|
| 59 |
return translation[0]['translation_text']
|
| 60 |
|
| 61 |
+
@classmethod
|
| 62 |
def quickmttranslate(model_path, input_text):
|
| 63 |
from quickmt import Translator
|
| 64 |
# 'auto' auto-detects GPU, set to "cpu" to force CPU inference
|
|
|
|
| 69 |
translation = translator(input_text, beam_size=5)[0]
|
| 70 |
return translation
|
| 71 |
|
| 72 |
+
@classmethod
|
| 73 |
def quickmtdownload(model_name):
|
| 74 |
from pathlib import Path
|
| 75 |
model_path = Path("/quickmt/models") / model_name
|