Spaces:
Runtime error
Runtime error
Update frontend.py
Browse files- frontend.py +10 -8
frontend.py
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from backend import responder_pregunta
|
| 3 |
|
| 4 |
-
demo = gr.
|
| 5 |
-
responder_pregunta,
|
|
|
|
|
|
|
| 6 |
title="🤖 ChatBot Ayacucho",
|
| 7 |
-
description="Asistente histórico
|
| 8 |
examples=[
|
| 9 |
-
"¿Qué fue la Batalla de Ayacucho?",
|
| 10 |
-
"¿Quién ganó la batalla?",
|
| 11 |
-
"¿Qué consecuencias tuvo?",
|
| 12 |
-
|
| 13 |
-
],
|
| 14 |
)
|
|
|
|
| 1 |
+
# frontend.py
|
| 2 |
import gradio as gr
|
| 3 |
from backend import responder_pregunta
|
| 4 |
|
| 5 |
+
demo = gr.Interface(
|
| 6 |
+
fn=responder_pregunta,
|
| 7 |
+
inputs=gr.Textbox(placeholder="Haz una pregunta sobre la Batalla de Ayacucho"),
|
| 8 |
+
outputs="text",
|
| 9 |
title="🤖 ChatBot Ayacucho",
|
| 10 |
+
description="Asistente histórico sobre la Batalla de Ayacucho",
|
| 11 |
examples=[
|
| 12 |
+
["¿Qué fue la Batalla de Ayacucho?"],
|
| 13 |
+
["¿Quién ganó la batalla?"],
|
| 14 |
+
["¿Qué consecuencias tuvo?"],
|
| 15 |
+
]
|
|
|
|
| 16 |
)
|