Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,9 @@ def get_text_embedding(text):
|
|
46 |
doc_path = hf_hub_download(repo_id="xavierbarbier/rag_ngap", filename="resource/embeddings_ngap.faiss", repo_type="space")
|
47 |
index = faiss.read_index(doc_path)
|
48 |
|
|
|
|
|
|
|
49 |
def qa(question):
|
50 |
"""Fonction principale pour répondre à la question en utilisant RAG avec jusqu'à 5 chunks."""
|
51 |
if not GEMINI_API_KEY:
|
|
|
46 |
doc_path = hf_hub_download(repo_id="xavierbarbier/rag_ngap", filename="resource/embeddings_ngap.faiss", repo_type="space")
|
47 |
index = faiss.read_index(doc_path)
|
48 |
|
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:
|