Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -135,13 +135,6 @@ def run_graph(question: str):
|
|
135 |
result = graph.invoke({"question": question})
|
136 |
return result["response"]
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
# Create a global list to store uploaded document records
|
146 |
uploaded_documents = []
|
147 |
|
@@ -189,8 +182,11 @@ with gr.Blocks() as demo:
|
|
189 |
with gr.Column():
|
190 |
response_output = gr.Textbox(label="Response:", lines=10, max_lines=10)
|
191 |
query_input = gr.Textbox(label="Enter your query:")
|
192 |
-
|
|
|
|
|
193 |
query_button.click(fn=run_graph, inputs=query_input, outputs=response_output)
|
|
|
194 |
with gr.Column():
|
195 |
file_input = gr.File(label="Upload PDF", file_types=[".pdf"])
|
196 |
document_table = gr.Dataframe(headers=["Document Name", "Upload Time", "Chunks", "Pinecone Index"], interactive=False)
|
|
|
135 |
result = graph.invoke({"question": question})
|
136 |
return result["response"]
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
# Create a global list to store uploaded document records
|
139 |
uploaded_documents = []
|
140 |
|
|
|
182 |
with gr.Column():
|
183 |
response_output = gr.Textbox(label="Response:", lines=10, max_lines=10)
|
184 |
query_input = gr.Textbox(label="Enter your query:")
|
185 |
+
with gr.Row():
|
186 |
+
query_button = gr.Button("Get Response")
|
187 |
+
clear_button = gr.Button("Clear") # New Clear button
|
188 |
query_button.click(fn=run_graph, inputs=query_input, outputs=response_output)
|
189 |
+
clear_button.click(fn=clear_inputs, inputs=[], outputs=[query_input, response_output]) # Clear both input and output
|
190 |
with gr.Column():
|
191 |
file_input = gr.File(label="Upload PDF", file_types=[".pdf"])
|
192 |
document_table = gr.Dataframe(headers=["Document Name", "Upload Time", "Chunks", "Pinecone Index"], interactive=False)
|