Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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="
|
| 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 |
-
|
| 30 |
|
| 31 |
-
translate_btn.click(fn=translate, inputs=[english], outputs=[
|
| 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 |
|