wayne0019 commited on
Commit
10b7b4a
·
1 Parent(s): 98c1705

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -14,7 +14,7 @@ from transformers import pipeline
14
 
15
  # pipe = pipeline("translation_en_to_fr", model="t5-base") # translate English to France
16
 
17
- pipe = pipeline("translation_en_to_fr", model="/Users/wayne/.cache/huggingface/hub/models--t5-base-lwf/snapshots/fe6d9bf207cd3337512ca838a8b453f87a9178ef")
18
 
19
  def translate(text):
20
  return pipe(text)[0]['translation_text']
@@ -26,9 +26,9 @@ with gr.Blocks() as demo:
26
  english = gr.Textbox(label="English text")
27
  translate_btn = gr.Button(value="Translate")
28
  with gr.Column():
29
- german = gr.Textbox(label="German text")
30
 
31
- translate_btn.click(fn=translate, inputs=[english], outputs=[german])
32
  examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."], inputs=[english])
33
 
34
 
 
14
 
15
  # pipe = pipeline("translation_en_to_fr", model="t5-base") # translate English to France
16
 
17
+ pipe = pipeline("translation_en_to_fr", model="t5-base")
18
 
19
  def translate(text):
20
  return pipe(text)[0]['translation_text']
 
26
  english = gr.Textbox(label="English text")
27
  translate_btn = gr.Button(value="Translate")
28
  with gr.Column():
29
+ France = gr.Textbox(label="France text")
30
 
31
+ translate_btn.click(fn=translate, inputs=[english], outputs=[France])
32
  examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."], inputs=[english])
33
 
34