Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,6 @@ def process_and_query(state, question):
|
|
140 |
|
141 |
# Initialize an empty state variable to store conversation history
|
142 |
state = []
|
143 |
-
|
144 |
# Create Gradio interface
|
145 |
with gr.Blocks() as demo:
|
146 |
gr.Markdown("## Document Upload and Query System")
|
@@ -152,13 +151,18 @@ with gr.Blocks() as demo:
|
|
152 |
upload_button.click(fn=upload_files, inputs=upload, outputs=upload_output)
|
153 |
|
154 |
with gr.Tab("Query"):
|
155 |
-
|
156 |
query_button = gr.Button("Search")
|
157 |
query_output = gr.Textbox()
|
158 |
-
|
|
|
|
|
|
|
|
|
159 |
# Setup the click event with correct inputs and outputs
|
160 |
-
query_button.click(fn=process_and_query, inputs=
|
161 |
|
162 |
demo.launch()
|
163 |
|
164 |
|
|
|
|
140 |
|
141 |
# Initialize an empty state variable to store conversation history
|
142 |
state = []
|
|
|
143 |
# Create Gradio interface
|
144 |
with gr.Blocks() as demo:
|
145 |
gr.Markdown("## Document Upload and Query System")
|
|
|
151 |
upload_button.click(fn=upload_files, inputs=upload, outputs=upload_output)
|
152 |
|
153 |
with gr.Tab("Query"):
|
154 |
+
query_input = gr.Textbox(label="Enter your query")
|
155 |
query_button = gr.Button("Search")
|
156 |
query_output = gr.Textbox()
|
157 |
+
|
158 |
+
# Define function to handle query
|
159 |
+
def query_text():
|
160 |
+
return query_input, query_output
|
161 |
+
|
162 |
# Setup the click event with correct inputs and outputs
|
163 |
+
query_button.click(fn=process_and_query, inputs=query_text, outputs=query_output)
|
164 |
|
165 |
demo.launch()
|
166 |
|
167 |
|
168 |
+
|