Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def translation(source, target, text):
|
|
38 |
tokenizer = model_dict[model_name + '_tokenizer']
|
39 |
|
40 |
translator = pipeline('translation', model=model, tokenizer=tokenizer, src_lang=source, tgt_lang=target)
|
41 |
-
output = translator(text, max_length=
|
42 |
|
43 |
end_time = time.time()
|
44 |
|
@@ -59,7 +59,7 @@ if __name__ == '__main__':
|
|
59 |
#inputs = [gr.inputs.Radio(['nllb-distilled-600M', 'nllb-1.3B', 'nllb-distilled-1.3B'], label='NLLB Model'),
|
60 |
inputs = [gr.inputs.Dropdown(lang_codes, default='English', label='Source'),
|
61 |
gr.inputs.Dropdown(lang_codes, default='Vietnamese', label='Target'),
|
62 |
-
gr.inputs.Textbox(lines=
|
63 |
]
|
64 |
|
65 |
outputs = gr.outputs.JSON()
|
|
|
38 |
tokenizer = model_dict[model_name + '_tokenizer']
|
39 |
|
40 |
translator = pipeline('translation', model=model, tokenizer=tokenizer, src_lang=source, tgt_lang=target)
|
41 |
+
output = translator(text, max_length=4096)
|
42 |
|
43 |
end_time = time.time()
|
44 |
|
|
|
59 |
#inputs = [gr.inputs.Radio(['nllb-distilled-600M', 'nllb-1.3B', 'nllb-distilled-1.3B'], label='NLLB Model'),
|
60 |
inputs = [gr.inputs.Dropdown(lang_codes, default='English', label='Source'),
|
61 |
gr.inputs.Dropdown(lang_codes, default='Vietnamese', label='Target'),
|
62 |
+
gr.inputs.Textbox(lines=100, label="Input text"),
|
63 |
]
|
64 |
|
65 |
outputs = gr.outputs.JSON()
|