Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -342,9 +342,11 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
342 |
|
343 |
answer = generate_chunked_response(model, formatted_prompt)
|
344 |
else:
|
345 |
-
if
|
346 |
return "No documents available. Please upload documents or enable web search to answer questions."
|
347 |
|
|
|
|
|
348 |
history_str = "\n".join([f"Q: {item['question']}\nA: {item['answer']}" for item in conversation_history])
|
349 |
|
350 |
if is_related_to_history(question, conversation_history):
|
|
|
342 |
|
343 |
answer = generate_chunked_response(model, formatted_prompt)
|
344 |
else:
|
345 |
+
if not os.path.exists("faiss_database"):
|
346 |
return "No documents available. Please upload documents or enable web search to answer questions."
|
347 |
|
348 |
+
database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
|
349 |
+
|
350 |
history_str = "\n".join([f"Q: {item['question']}\nA: {item['answer']}" for item in conversation_history])
|
351 |
|
352 |
if is_related_to_history(question, conversation_history):
|