vishwask commited on
Commit
3acc5cc
·
verified ·
1 Parent(s): aab0a5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -165,7 +165,7 @@ def demo():
165
  msg = gr.Textbox(placeholder="Type message", container=True)
166
  with gr.Row():
167
  #db_btn = gr.Button('Initialize database')
168
- qachain_btn = gr.Button('Start chatbot')
169
  submit_btn = gr.Button("Submit")
170
  clear_btn = gr.ClearButton([msg, chatbot])
171
 
@@ -177,13 +177,15 @@ def demo():
177
  # inputs=[document], \
178
  # outputs=[vector_db, collection_name])
179
 
180
- qachain_btn.click(initialize_LLM, \
181
- inputs=[vector_db], \
182
- outputs=[qa_chain]).then(lambda:[0], \
183
- inputs=None, \
184
- outputs=[chatbot, doc_source1, source1_page, doc_source2, source2_page, doc_source3, source3_page], \
185
- queue=False)
186
-
 
 
187
  # Chatbot events
188
  msg.submit(conversation, \
189
  inputs=[qa_chain, msg, chatbot], \
 
165
  msg = gr.Textbox(placeholder="Type message", container=True)
166
  with gr.Row():
167
  #db_btn = gr.Button('Initialize database')
168
+ #qachain_btn = gr.Button('Start chatbot')
169
  submit_btn = gr.Button("Submit")
170
  clear_btn = gr.ClearButton([msg, chatbot])
171
 
 
177
  # inputs=[document], \
178
  # outputs=[vector_db, collection_name])
179
 
180
+ # qachain_btn.click(initialize_LLM, \
181
+ # inputs=[vector_db], \
182
+ # outputs=[qa_chain]).then(lambda:[0], \
183
+ # inputs=None, \
184
+ # outputs=[chatbot, doc_source1, source1_page, doc_source2, source2_page, doc_source3, source3_page], \
185
+ # queue=False)
186
+
187
+ qachain = initialize_LLM(vector_db)
188
+
189
  # Chatbot events
190
  msg.submit(conversation, \
191
  inputs=[qa_chain, msg, chatbot], \