Update app.py
Browse files
app.py
CHANGED
@@ -243,7 +243,7 @@ with gr.Blocks() as demo:
|
|
243 |
|
244 |
def handle_upload(file):
|
245 |
success, message = process_uploaded_file(file)
|
246 |
-
return message, gr.
|
247 |
|
248 |
def update_schema():
|
249 |
schema = get_table_schema()
|
@@ -253,17 +253,17 @@ with gr.Blocks() as demo:
|
|
253 |
|
254 |
def switch_to_query():
|
255 |
return {
|
256 |
-
upload_group: gr.
|
257 |
-
query_group: gr.
|
258 |
schema_display: update_schema()
|
259 |
}
|
260 |
|
261 |
def switch_to_upload():
|
262 |
return {
|
263 |
-
upload_group: gr.
|
264 |
-
query_group: gr.
|
265 |
-
continue_btn: gr.
|
266 |
-
upload_status: gr.
|
267 |
}
|
268 |
|
269 |
# Event handlers
|
@@ -300,4 +300,4 @@ with gr.Blocks() as demo:
|
|
300 |
)
|
301 |
|
302 |
if __name__ == "__main__":
|
303 |
-
demo.launch(server_name="0.0.0.0", server_port=7860
|
|
|
243 |
|
244 |
def handle_upload(file):
|
245 |
success, message = process_uploaded_file(file)
|
246 |
+
return message, gr.update(visible=success)
|
247 |
|
248 |
def update_schema():
|
249 |
schema = get_table_schema()
|
|
|
253 |
|
254 |
def switch_to_query():
|
255 |
return {
|
256 |
+
upload_group: gr.update(visible=False),
|
257 |
+
query_group: gr.update(visible=True),
|
258 |
schema_display: update_schema()
|
259 |
}
|
260 |
|
261 |
def switch_to_upload():
|
262 |
return {
|
263 |
+
upload_group: gr.update(visible=True),
|
264 |
+
query_group: gr.update(visible=False),
|
265 |
+
continue_btn: gr.update(visible=False),
|
266 |
+
upload_status: gr.update(value="")
|
267 |
}
|
268 |
|
269 |
# Event handlers
|
|
|
300 |
)
|
301 |
|
302 |
if __name__ == "__main__":
|
303 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|