Spaces:
Sleeping
Sleeping
Arreglos en la interfaz
Browse files
app.py
CHANGED
@@ -59,14 +59,13 @@ def chat_biblioteca(pregunta):
|
|
59 |
try:
|
60 |
resultado = qa_pipeline(question=pregunta, context=contexto)
|
61 |
respuesta = resultado["answer"]
|
62 |
-
return respuesta
|
63 |
except:
|
64 |
-
|
|
|
|
|
65 |
|
66 |
|
67 |
-
# --- Interfaz
|
68 |
-
iface = gr.Interface(
|
69 |
-
# --- Interfaz tipo chat oscuro ---
|
70 |
gr.ChatInterface(
|
71 |
fn=responder,
|
72 |
title="📚 BiblioBot",
|
@@ -76,6 +75,3 @@ gr.ChatInterface(
|
|
76 |
retry_btn="Reintentar",
|
77 |
clear_btn="Borrar historial",
|
78 |
).launch()
|
79 |
-
)
|
80 |
-
|
81 |
-
iface.launch()
|
|
|
59 |
try:
|
60 |
resultado = qa_pipeline(question=pregunta, context=contexto)
|
61 |
respuesta = resultado["answer"]
|
|
|
62 |
except:
|
63 |
+
respuesta= "Lo siento, no pude procesar tu pregunta. ¿Puedes intentar reformularla?"
|
64 |
+
|
65 |
+
return historial + [[mensaje, respuesta]]
|
66 |
|
67 |
|
68 |
+
# --- Interfaz tipo chat oscuro ---
|
|
|
|
|
69 |
gr.ChatInterface(
|
70 |
fn=responder,
|
71 |
title="📚 BiblioBot",
|
|
|
75 |
retry_btn="Reintentar",
|
76 |
clear_btn="Borrar historial",
|
77 |
).launch()
|
|
|
|
|
|