lakshmi324 commited on
Commit
2665d9f
·
1 Parent(s): 21adbe8

Update app.py

Browse files

updated the default value of the check type and chunks

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -33,14 +33,14 @@ def qa_system(pdf_file, openai_key, prompt, chain_type, k):
33
 
34
  # get the result
35
  result = qa({"query": prompt})
36
- return result['result'], [doc.page_content for doc in result["source_documents"]]
37
 
38
  # define the Gradio interface
39
  input_file = gr.inputs.File(label="PDF File")
40
  openai_key = gr.inputs.Textbox(label="OpenAI API Key", type="password")
41
  prompt = gr.inputs.Textbox(label="Question Prompt")
42
- chain_type = gr.inputs.Radio(['stuff', 'map_reduce', "refine", "map_rerank"], label="Chain Type")
43
- k = gr.inputs.Slider(minimum=1, maximum=5, default=1, label="Number of Relevant Chunks")
44
 
45
  output_text = gr.outputs.Textbox(label="Answer")
46
  output_docs = gr.outputs.Textbox(label="Relevant Source Text")
 
33
 
34
  # get the result
35
  result = qa({"query": prompt})
36
+ return result['result'], ''.join(doc.page_content for doc in result["source_documents"])
37
 
38
  # define the Gradio interface
39
  input_file = gr.inputs.File(label="PDF File")
40
  openai_key = gr.inputs.Textbox(label="OpenAI API Key", type="password")
41
  prompt = gr.inputs.Textbox(label="Question Prompt")
42
+ chain_type = gr.inputs.Radio(['stuff', 'map_reduce', "refine", "map_rerank"],default = 'map_reduce',label="Chain Type")
43
+ k = gr.inputs.Slider(minimum=1, maximum=5, default=2, label="Number of Relevant Chunks")
44
 
45
  output_text = gr.outputs.Textbox(label="Answer")
46
  output_docs = gr.outputs.Textbox(label="Relevant Source Text")