Samarth991 commited on
Commit
fdcda98
1 Parent(s): de8093f

adding chatbot

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -67,8 +67,9 @@ def document_loader(file_path,api_key,doc_type='pdf',llm='Huggingface'):
67
  chain_type='stuff',
68
  retriever=vector_db.as_retriever(),
69
  # chain_type_kwargs=chain_type_kwargs,
70
- # return_source_documents=True
71
  )
 
72
  else:
73
  return "Error in loading Documents "
74
 
@@ -152,10 +153,10 @@ with gr.Blocks(css=css) as demo:
152
  with gr.Box():
153
  pdf_doc = gr.File(label="Upload File to start QA", file_types=FILE_EXT, type="file")
154
  with gr.Row():
155
- langchain_status = gr.Textbox(label="Status", placeholder="", interactive=True)
156
- load_pdf = gr.Button("Upload File & Generate Embeddings",).style(full_width=False)
157
 
158
- # chatbot = gr.Chatbot()
159
  # question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter")
160
  # submit_button = gr.Button("Send Message")
161
 
 
67
  chain_type='stuff',
68
  retriever=vector_db.as_retriever(),
69
  # chain_type_kwargs=chain_type_kwargs,
70
+ return_source_documents=True
71
  )
72
+ print(qa)
73
  else:
74
  return "Error in loading Documents "
75
 
 
153
  with gr.Box():
154
  pdf_doc = gr.File(label="Upload File to start QA", file_types=FILE_EXT, type="file")
155
  with gr.Row():
156
+ langchain_status = gr.Textbox(label="Status", placeholder="", interactive = False)
157
+ load_pdf = gr.Button("Upload File & Generate Embeddings",).style(full_width = False)
158
 
159
+ # chatbot = gr.Chatbot()
160
  # question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter")
161
  # submit_button = gr.Button("Send Message")
162