Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,8 @@ def answer_predefined_questions(document_type):
|
|
110 |
def answer_query(query):
|
111 |
question = query
|
112 |
response = "Field Name: Location; Question sent to gpt-4: ", question, "Response from gpt-4:",pdf_qa.run(question)
|
113 |
-
return response
|
|
|
114 |
|
115 |
css="""
|
116 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
@@ -135,17 +136,17 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
|
|
135 |
|
136 |
with gr.Row():
|
137 |
status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
138 |
-
load_pdf = gr.Button("Load PDF")
|
139 |
|
140 |
with gr.Row():
|
141 |
document_type = gr.Radio(['Deed of Trust', 'Transmittal Summary'], label="Select the Document Type")
|
142 |
answers = gr.Textbox(label="Answers to Predefined Question set")
|
143 |
-
answers_for_predefined_question_set = gr.Button("Get Answers to Pre-defined Question set")
|
144 |
|
145 |
with gr.Row():
|
146 |
input = gr.Textbox(label="Type in your question")
|
147 |
-
output = gr.
|
148 |
-
submit_query = gr.Button("Submit your own question")
|
149 |
|
150 |
|
151 |
load_pdf.click(load_pdf_and_generate_embeddings, inputs=[pdf_doc, openai_key], outputs=status)
|
|
|
110 |
def answer_query(query):
|
111 |
question = query
|
112 |
response = "Field Name: Location; Question sent to gpt-4: ", question, "Response from gpt-4:",pdf_qa.run(question)
|
113 |
+
#return response
|
114 |
+
return pd.DataFrame({"Field": ['Location'], "Question": ['what is the location'], "Answer": ['Coppell,TX']})
|
115 |
|
116 |
css="""
|
117 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
|
|
136 |
|
137 |
with gr.Row():
|
138 |
status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
139 |
+
load_pdf = gr.Button(label="Load PDF").style(full_width=False)
|
140 |
|
141 |
with gr.Row():
|
142 |
document_type = gr.Radio(['Deed of Trust', 'Transmittal Summary'], label="Select the Document Type")
|
143 |
answers = gr.Textbox(label="Answers to Predefined Question set")
|
144 |
+
answers_for_predefined_question_set = gr.Button(label="Get Answers to Pre-defined Question set").style(full_width=False)
|
145 |
|
146 |
with gr.Row():
|
147 |
input = gr.Textbox(label="Type in your question")
|
148 |
+
output = gr.Dataframe(label="Answer")
|
149 |
+
submit_query = gr.Button(label ="Submit your own question").style(full_width=False)
|
150 |
|
151 |
|
152 |
load_pdf.click(load_pdf_and_generate_embeddings, inputs=[pdf_doc, openai_key], outputs=status)
|