Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ index = faiss.read_index(doc_path)
|
|
49 |
if not index:
|
50 |
print("Problème index")
|
51 |
|
52 |
-
def qa(question):
|
53 |
"""Fonction principale pour répondre à la question en utilisant RAG avec jusqu'à 5 chunks."""
|
54 |
if not GEMINI_API_KEY:
|
55 |
return "Erreur : La clé API Gemini n'est pas configurée.", ""
|
@@ -107,7 +107,8 @@ with gr.Blocks() as demo:
|
|
107 |
qa_button.click(
|
108 |
fn=qa,
|
109 |
inputs=question_input,
|
110 |
-
outputs=[answer_output, prompt_output]
|
|
|
111 |
)
|
112 |
|
113 |
if __name__ == "__main__":
|
|
|
49 |
if not index:
|
50 |
print("Problème index")
|
51 |
|
52 |
+
def qa(question, index):
|
53 |
"""Fonction principale pour répondre à la question en utilisant RAG avec jusqu'à 5 chunks."""
|
54 |
if not GEMINI_API_KEY:
|
55 |
return "Erreur : La clé API Gemini n'est pas configurée.", ""
|
|
|
107 |
qa_button.click(
|
108 |
fn=qa,
|
109 |
inputs=question_input,
|
110 |
+
outputs=[answer_output, prompt_output],
|
111 |
+
extra_inputs=[index]
|
112 |
)
|
113 |
|
114 |
if __name__ == "__main__":
|