Update app.py
Browse files
app.py
CHANGED
|
@@ -75,5 +75,18 @@ def test_rag_reranking(query,ranker):
|
|
| 75 |
|
| 76 |
ranker = Reranker("answerdotai/answerai-colbert-small-v1", model_type='colbert')
|
| 77 |
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
iface.launch()
|
|
|
|
| 75 |
|
| 76 |
ranker = Reranker("answerdotai/answerai-colbert-small-v1", model_type='colbert')
|
| 77 |
|
| 78 |
+
# Función de respuesta simple usando test_rag
|
| 79 |
+
def chat_function(message, history):
|
| 80 |
+
respuesta, _ = test_rag(message)
|
| 81 |
+
return respuesta
|
| 82 |
+
|
| 83 |
+
# Interfaz de chat
|
| 84 |
+
iface = gr.ChatInterface(
|
| 85 |
+
fn=chat_function,
|
| 86 |
+
chatbot=gr.Chatbot(),
|
| 87 |
+
title="RAG Bot",
|
| 88 |
+
description="Hazme preguntas sobre el contenido del PDF.",
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
# Lanzar interfaz
|
| 92 |
iface.launch()
|