lekkalar commited on
Commit
6755c1e
1 Parent(s): 37b4a4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def load_pdf_and_generate_embeddings(pdf_doc, open_ai_key):
35
  Return the key fields from the question followed by : and the answer :"""
36
  PROMPT = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
37
  chain_type_kwargs = {"prompt": PROMPT}
38
- pdf_qa = RetrievalQA.from_chain_type(llm=ChatOpenAI(temperature=0, model_name="gpt-4"),chain_type="stuff", retriever=vectordb.as_retriever(search_kwargs={"k": 1}), chain_type_kwargs=chain_type_kwargs, return_source_documents=False)
39
 
40
  return "Ready"
41
  else:
@@ -120,7 +120,7 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
120
  with gr.Row():
121
  document_type = gr.Radio(['Deed of Trust', 'Transmittal Summary'], label="Select the Document Type")
122
  answers = gr.Dataframe(label="Answers to Predefined Question set")
123
- answers_for_predefined_question_set = gr.Button("Get Answers to Pre-defined Question set").style(full_width=False)
124
 
125
  with gr.Row():
126
  input = gr.Textbox(label="Type in your question")
 
35
  Return the key fields from the question followed by : and the answer :"""
36
  PROMPT = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
37
  chain_type_kwargs = {"prompt": PROMPT}
38
+ pdf_qa = RetrievalQA.from_chain_type(llm=ChatOpenAI(temperature=0, model_name="gpt-4"),chain_type="stuff", retriever=vectordb.as_retriever(), chain_type_kwargs=chain_type_kwargs, return_source_documents=False)
39
 
40
  return "Ready"
41
  else:
 
120
  with gr.Row():
121
  document_type = gr.Radio(['Deed of Trust', 'Transmittal Summary'], label="Select the Document Type")
122
  answers = gr.Dataframe(label="Answers to Predefined Question set")
123
+ answers_for_predefined_question_set = gr.Button("Get gpt-4 answers to pre-defined question set").style(full_width=False)
124
 
125
  with gr.Row():
126
  input = gr.Textbox(label="Type in your question")