Fecalisboa commited on
Commit
024f8c1
·
verified ·
1 Parent(s): 8dabaa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -204,7 +204,7 @@ def demo():
204
 
205
  with gr.Tab("Step 2 - Process document"):
206
  with gr.Row():
207
- db_btn = gr.Radio(["ChromaDB", "FAISS", "ScaNN", "Milvus"], label="Vector database type", value="ChromaDB", type="index", info="Choose your vector database")
208
  with gr.Accordion("Advanced options - Document text splitter", open=False):
209
  with gr.Row():
210
  slider_chunk_size = gr.Slider(minimum=100, maximum=1000, value=600, step=20, label="Chunk size", info="Chunk size", interactive=True)
@@ -251,7 +251,7 @@ def demo():
251
 
252
  # Preprocessing events
253
  db_btn.click(initialize_database,
254
- inputs=[document, slider_chunk_size, slider_chunk_overlap, db_btn],
255
  outputs=[vector_db, collection_name, db_progress])
256
  qachain_btn.click(initialize_LLM,
257
  inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db],
@@ -276,4 +276,4 @@ def demo():
276
  demo.queue().launch(debug=True)
277
 
278
  if __name__ == "__main__":
279
- demo()
 
204
 
205
  with gr.Tab("Step 2 - Process document"):
206
  with gr.Row():
207
+ db_type_radio = gr.Radio(["ChromaDB", "FAISS", "ScaNN", "Milvus"], label="Vector database type", value="ChromaDB", type="value", info="Choose your vector database")
208
  with gr.Accordion("Advanced options - Document text splitter", open=False):
209
  with gr.Row():
210
  slider_chunk_size = gr.Slider(minimum=100, maximum=1000, value=600, step=20, label="Chunk size", info="Chunk size", interactive=True)
 
251
 
252
  # Preprocessing events
253
  db_btn.click(initialize_database,
254
+ inputs=[document, slider_chunk_size, slider_chunk_overlap, db_type_radio],
255
  outputs=[vector_db, collection_name, db_progress])
256
  qachain_btn.click(initialize_LLM,
257
  inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db],
 
276
  demo.queue().launch(debug=True)
277
 
278
  if __name__ == "__main__":
279
+ demo()