Rabbitt-AI commited on
Commit
a352b3f
·
verified ·
1 Parent(s): 3f0e09a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -408,7 +408,7 @@ def create_vector_db_and_annoy_index(pdf_path, vector_db_path, annoy_index_path)
408
 
409
  import gradio as gr
410
 
411
- def chatbot_interface(user_query, response_style, selected_retrieval_methods, selected_reranking_methods, file, chunk_size, overlap):
412
  vector_db_path = "vector_db.pkl"
413
  annoy_index_path = "vector_index.ann"
414
 
@@ -448,12 +448,11 @@ iface = gr.Interface(
448
  fn=chatbot_interface,
449
  theme='Rabbitt-AI/ChanceRAG',
450
  inputs=[
451
- # gr.File(label="Upload a PDF"),
452
  gr.Textbox(lines=5, label="User Query"),
453
  gr.Dropdown(["Detailed", "Concise", "Creative", "Technical"], label="Response Style"),
454
  gr.Dropdown(["annoy", "tfidf", "bm25", "euclidean", "jaccard"], label="Retrieval Methods", multiselect=True), # This line is changed
455
  gr.Dropdown(["advanced_fusion", "reciprocal_rank_fusion", "weighted_score_fusion", "semantic_similarity"], label="Reranking Methods"),
456
- gr.File(label="Upload a PDF"),
457
  gr.Slider(minimum=1024, maximum=2048, step=128, value=2048, label="Chunk Size"),
458
  gr.Slider(minimum=100, maximum=300, step=100, value=200, label="Overlap")
459
  ],
 
408
 
409
  import gradio as gr
410
 
411
+ def chatbot_interface(file, user_query, response_style, selected_retrieval_methods, selected_reranking_methods, chunk_size, overlap):
412
  vector_db_path = "vector_db.pkl"
413
  annoy_index_path = "vector_index.ann"
414
 
 
448
  fn=chatbot_interface,
449
  theme='Rabbitt-AI/ChanceRAG',
450
  inputs=[
451
+ gr.File(label="Upload a PDF"),
452
  gr.Textbox(lines=5, label="User Query"),
453
  gr.Dropdown(["Detailed", "Concise", "Creative", "Technical"], label="Response Style"),
454
  gr.Dropdown(["annoy", "tfidf", "bm25", "euclidean", "jaccard"], label="Retrieval Methods", multiselect=True), # This line is changed
455
  gr.Dropdown(["advanced_fusion", "reciprocal_rank_fusion", "weighted_score_fusion", "semantic_similarity"], label="Reranking Methods"),
 
456
  gr.Slider(minimum=1024, maximum=2048, step=128, value=2048, label="Chunk Size"),
457
  gr.Slider(minimum=100, maximum=300, step=100, value=200, label="Overlap")
458
  ],