Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -287,7 +287,7 @@ with gr.Blocks() as demo:
|
|
287 |
# uploaded_files], outputs=[dataset])
|
288 |
query = gr.Textbox(
|
289 |
placeholder="Introduzca su pregunta aquí...", label="Pregunta")
|
290 |
-
|
291 |
gr.Markdown("## Respuesta")
|
292 |
answer = gr.Markdown(label="Respuesta")
|
293 |
prob = gr.Markdown(label="Probabilidades")
|
@@ -297,12 +297,10 @@ with gr.Blocks() as demo:
|
|
297 |
context = gr.Markdown(label="Contexto")
|
298 |
# ask.click(fn=do_ask, inputs=[query, buildb,
|
299 |
# dataset], outputs=[answer, context])
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
gr.
|
304 |
-
outputs=[answer, context, prob],
|
305 |
-
examples = [["¿Cuándo suelen comenzar las adicciones?","Entrevista Miguel Ruiz.txt"]])
|
306 |
|
307 |
demo.queue(concurrency_count=20)
|
308 |
demo.launch(show_error=True)
|
|
|
287 |
# uploaded_files], outputs=[dataset])
|
288 |
query = gr.Textbox(
|
289 |
placeholder="Introduzca su pregunta aquí...", label="Pregunta")
|
290 |
+
ask = gr.Button("Preguntar")
|
291 |
gr.Markdown("## Respuesta")
|
292 |
answer = gr.Markdown(label="Respuesta")
|
293 |
prob = gr.Markdown(label="Probabilidades")
|
|
|
297 |
context = gr.Markdown(label="Contexto")
|
298 |
# ask.click(fn=do_ask, inputs=[query, buildb,
|
299 |
# dataset], outputs=[answer, context])
|
300 |
+
ask.click(fn=predict, inputs=[query,
|
301 |
+
file], outputs=[answer, context, prob],
|
302 |
+
examples = [["¿Cuándo suelen comenzar las adicciones?","Entrevista Miguel Ruiz.txt"]])
|
303 |
+
examples = gr.Examples(examples=["¿Cuándo suelen comenzar las adicciones?","Entrevista Miguel Ruiz.txt"])
|
|
|
|
|
304 |
|
305 |
demo.queue(concurrency_count=20)
|
306 |
demo.launch(show_error=True)
|