ogaith commited on
Commit
ade444b
·
1 Parent(s): 766c816

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import os
2
  import io
3
  import tempfile
4
  from typing import List
5
-
6
  import gradio as gr
7
  from huggingface_hub import snapshot_download
8
  import ctranslate2
@@ -117,7 +117,7 @@ with gr.Blocks() as demo:
117
 
118
  gr.Markdown("### Translate an uploaded file")
119
  with gr.Row():
120
- inp = gr.File(label="Upload .txt (UTF-8)", file_count="single", type="bytes")
121
  btn_upload = gr.Button("Translate uploaded file")
122
  out_file_upload = gr.File(label="Download translations (.txt)")
123
  out_preview_upload = gr.Textbox(label="Preview (first 10 lines)", lines=10)
 
2
  import io
3
  import tempfile
4
  from typing import List
5
+ import re
6
  import gradio as gr
7
  from huggingface_hub import snapshot_download
8
  import ctranslate2
 
117
 
118
  gr.Markdown("### Translate an uploaded file")
119
  with gr.Row():
120
+ inp = gr.File(label="Upload .txt (UTF-8)", file_count="single", type="binary")
121
  btn_upload = gr.Button("Translate uploaded file")
122
  out_file_upload = gr.File(label="Download translations (.txt)")
123
  out_preview_upload = gr.Textbox(label="Preview (first 10 lines)", lines=10)