Update app.py
Browse files
app.py
CHANGED
|
@@ -25,16 +25,16 @@ def traducir(texto):
|
|
| 25 |
texto_resumido = [tokenizer.decode(t, skip_special_tokens=True) for t in translated_resumido]
|
| 26 |
return texto_resumido[0], texto_completo
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
demo = gr.Interface(
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
)
|
| 39 |
|
| 40 |
demo.launch()
|
|
|
|
| 25 |
texto_resumido = [tokenizer.decode(t, skip_special_tokens=True) for t in translated_resumido]
|
| 26 |
return texto_resumido[0], texto_completo
|
| 27 |
|
| 28 |
+
with gr.Blocks() as demo:
|
| 29 |
+
text = gr.Textbox(label="Introduzca el texto a resumir y traducir")
|
| 30 |
+
output1 = gr.Textbox(label="Texto resumido y traducido")
|
| 31 |
+
output2 = gr.Textbox(label="Texto completo y traducido")
|
| 32 |
+
sumbtn = gr.Button("Resumir y traducir")
|
| 33 |
+
sumbtn.click(fn=traducir, inputs = text, outputs = (output1,output2))
|
| 34 |
+
# demo = gr.Interface(
|
| 35 |
+
# fn=traducir,
|
| 36 |
+
# inputs=[gr.Textbox(label="Texto")],
|
| 37 |
+
# outputs=[gr.Textbox(label="Texto completo traducido"), gr.Textbox(label="Texto resumido traducido")],
|
| 38 |
+
# )
|
| 39 |
|
| 40 |
demo.launch()
|