Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -234,7 +234,6 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
234 |
if os.path.exists("faiss_database"):
|
235 |
database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
|
236 |
else:
|
237 |
-
# If no database exists, we'll create it with the first web search or document upload
|
238 |
database = None
|
239 |
|
240 |
if web_search:
|
@@ -264,7 +263,7 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
264 |
formatted_prompt = prompt_val.format(context=context_str, question=question)
|
265 |
else:
|
266 |
if database is None:
|
267 |
-
return "No documents
|
268 |
|
269 |
history_str = "\n".join([f"Q: {item['question']}\nA: {item['answer']}" for item in conversation_history])
|
270 |
|
|
|
234 |
if os.path.exists("faiss_database"):
|
235 |
database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
|
236 |
else:
|
|
|
237 |
database = None
|
238 |
|
239 |
if web_search:
|
|
|
263 |
formatted_prompt = prompt_val.format(context=context_str, question=question)
|
264 |
else:
|
265 |
if database is None:
|
266 |
+
return "No documents available. Please upload documents or enable web search to answer questions."
|
267 |
|
268 |
history_str = "\n".join([f"Q: {item['question']}\nA: {item['answer']}" for item in conversation_history])
|
269 |
|