Spaces:
Sleeping
Sleeping
fix to handle error: ValueError: Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order.
Browse files
app.py
CHANGED
|
@@ -197,19 +197,19 @@ with gr.Blocks(title="PDF Chatbot") as demo:
|
|
| 197 |
try:
|
| 198 |
await process_pdf(file, new_state)
|
| 199 |
gr.Info("PDF processed successfully! You can now chat with it.")
|
| 200 |
-
return
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
except gr.Error as e:
|
| 206 |
# Display the Gradio error message to the user
|
| 207 |
gr.Error(str(e))
|
| 208 |
-
return
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
state
|
| 212 |
-
|
| 213 |
|
| 214 |
file_upload_input.upload(
|
| 215 |
fn=process_and_show_chat,
|
|
|
|
| 197 |
try:
|
| 198 |
await process_pdf(file, new_state)
|
| 199 |
gr.Info("PDF processed successfully! You can now chat with it.")
|
| 200 |
+
return [
|
| 201 |
+
gr.update(visible=True),
|
| 202 |
+
gr.update(interactive=False),
|
| 203 |
+
new_state,
|
| 204 |
+
]
|
| 205 |
except gr.Error as e:
|
| 206 |
# Display the Gradio error message to the user
|
| 207 |
gr.Error(str(e))
|
| 208 |
+
return [
|
| 209 |
+
gr.update(visible=False),
|
| 210 |
+
gr.update(interactive=True),
|
| 211 |
+
state, # Return original state on failure
|
| 212 |
+
]
|
| 213 |
|
| 214 |
file_upload_input.upload(
|
| 215 |
fn=process_and_show_chat,
|