Spaces:
Runtime error
Runtime error
captain-awesome
commited on
Commit
•
81c330c
1
Parent(s):
62026ce
Update app.py
Browse files
app.py
CHANGED
@@ -234,7 +234,7 @@ def create_chain(llm, prompt, CONDENSE_QUESTION_PROMPT, db):
|
|
234 |
)
|
235 |
return chain
|
236 |
|
237 |
-
def create_retrieval_qa_bot():
|
238 |
# if not os.path.exists(persist_dir):
|
239 |
# raise FileNotFoundError(f"No directory found at {persist_dir}")
|
240 |
|
@@ -267,7 +267,7 @@ def create_retrieval_qa_bot():
|
|
267 |
|
268 |
return qa
|
269 |
|
270 |
-
def retrieve_bot_answer(query):
|
271 |
"""
|
272 |
Retrieves the answer to a given query using a QA bot.
|
273 |
|
@@ -333,7 +333,7 @@ def main():
|
|
333 |
CONDENSE_QUESTION_PROMPT = set_custom_prompt_condense()
|
334 |
db = create_vector_database(loaded_documents)
|
335 |
st.write(f"db: {db}")
|
336 |
-
response = retrieve_bot_answer(query)
|
337 |
|
338 |
# Display bot response
|
339 |
st.write("Bot Response:")
|
|
|
234 |
)
|
235 |
return chain
|
236 |
|
237 |
+
def create_retrieval_qa_bot(loaded_documents):
|
238 |
# if not os.path.exists(persist_dir):
|
239 |
# raise FileNotFoundError(f"No directory found at {persist_dir}")
|
240 |
|
|
|
267 |
|
268 |
return qa
|
269 |
|
270 |
+
def retrieve_bot_answer(query, loaded_documents):
|
271 |
"""
|
272 |
Retrieves the answer to a given query using a QA bot.
|
273 |
|
|
|
333 |
CONDENSE_QUESTION_PROMPT = set_custom_prompt_condense()
|
334 |
db = create_vector_database(loaded_documents)
|
335 |
st.write(f"db: {db}")
|
336 |
+
response = retrieve_bot_answer(query,loaded_documents)
|
337 |
|
338 |
# Display bot response
|
339 |
st.write("Bot Response:")
|