Update app.py
Browse files
app.py
CHANGED
|
@@ -66,7 +66,7 @@ class Translators:
|
|
| 66 |
translator = Translator(str(model_path), device = device)
|
| 67 |
# translation = Translator(f"./quickmt-{self.sl}-{self.tl}/", device="auto", inter_threads=2)
|
| 68 |
# set beam size to 1 for faster speed (but lower quality)
|
| 69 |
-
translation = translator(input_text, beam_size=5,
|
| 70 |
# print(model_path, input_text, translation)
|
| 71 |
return translation
|
| 72 |
|
|
|
|
| 66 |
translator = Translator(str(model_path), device = device)
|
| 67 |
# translation = Translator(f"./quickmt-{self.sl}-{self.tl}/", device="auto", inter_threads=2)
|
| 68 |
# set beam size to 1 for faster speed (but lower quality)
|
| 69 |
+
translation = translator(input_text, beam_size=5, max_input_length = 512, max_decoding_length = 512)
|
| 70 |
# print(model_path, input_text, translation)
|
| 71 |
return translation
|
| 72 |
|