vteam27 commited on
Commit
0702769
·
1 Parent(s): 24332df

fixed download

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -25,8 +25,9 @@ def run_t2tt(file_uploader , input_text: str, source_language: str, target_langu
25
  text_inputs = processor(text = input_text, src_lang=source_language_code , return_tensors="pt")
26
  output_tokens = model.generate(**text_inputs, tgt_lang=target_language_code)
27
  output = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)
28
- translated_text_bytes = translated_text.encode("utf-8")
29
- return str(output), translated_text_bytes
 
30
 
31
  with gr.Blocks() as demo_t2tt:
32
  with gr.Row():
 
25
  text_inputs = processor(text = input_text, src_lang=source_language_code , return_tensors="pt")
26
  output_tokens = model.generate(**text_inputs, tgt_lang=target_language_code)
27
  output = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)
28
+ _output_name = "result.txt"
29
+ open(_output_name, 'w').write(output)
30
+ return str(output), _output_name
31
 
32
  with gr.Blocks() as demo_t2tt:
33
  with gr.Row():