Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -403,7 +403,7 @@ def create_vector_db_and_annoy_index(pdf_path, vector_db_path, annoy_index_path)
|
|
403 |
print("Vector database and Annoy index creation completed.")
|
404 |
|
405 |
|
406 |
-
def chatbot_interface(file, user_query, response_style
|
407 |
vector_db_path = "vector_db.pkl"
|
408 |
annoy_index_path = "vector_index.ann"
|
409 |
|
@@ -411,8 +411,8 @@ def chatbot_interface(file, user_query, response_style, selected_retrieval_metho
|
|
411 |
|
412 |
chatbot = MistralRAGChatbot(vector_db_path, annoy_index_path)
|
413 |
|
414 |
-
selected_retrieval_methods_list = [
|
415 |
-
selected_reranking_methods_list = [
|
416 |
|
417 |
response, retrieved_docs, source_info = asyncio.run(chatbot.generate_response_with_rag(
|
418 |
user_query=user_query,
|
@@ -440,11 +440,9 @@ iface = gr.Interface(
|
|
440 |
inputs=[
|
441 |
gr.File(label="Upload a PDF"),
|
442 |
gr.Textbox(lines=5, label="User Query"),
|
443 |
-
gr.Dropdown(["Detailed", "Concise", "Creative", "Technical"], label="
|
444 |
-
gr.
|
445 |
-
gr.
|
446 |
-
gr.Slider(minimum=1024, maximum=2048, step=128, value=2048, label="Chunk Size"),
|
447 |
-
gr.Slider(minimum=100, maximum=300, step=100, value=200, label="Overlap")
|
448 |
],
|
449 |
outputs=gr.Textbox(label="RAG Response"),
|
450 |
title="Chance RAG"
|
|
|
403 |
print("Vector database and Annoy index creation completed.")
|
404 |
|
405 |
|
406 |
+
def chatbot_interface(file, user_query, response_style):
|
407 |
vector_db_path = "vector_db.pkl"
|
408 |
annoy_index_path = "vector_index.ann"
|
409 |
|
|
|
411 |
|
412 |
chatbot = MistralRAGChatbot(vector_db_path, annoy_index_path)
|
413 |
|
414 |
+
selected_retrieval_methods_list = ['annoy', 'bm25']
|
415 |
+
selected_reranking_methods_list = ["advanced_fusion"]
|
416 |
|
417 |
response, retrieved_docs, source_info = asyncio.run(chatbot.generate_response_with_rag(
|
418 |
user_query=user_query,
|
|
|
440 |
inputs=[
|
441 |
gr.File(label="Upload a PDF"),
|
442 |
gr.Textbox(lines=5, label="User Query"),
|
443 |
+
gr.Dropdown(["Detailed", "Concise", "Creative", "Technical"], label="Retreival Style"),
|
444 |
+
gr.Markdown("#Retreival Method"),
|
445 |
+
gr.Mardown("##advanced_fusion")
|
|
|
|
|
446 |
],
|
447 |
outputs=gr.Textbox(label="RAG Response"),
|
448 |
title="Chance RAG"
|