Spaces:
Running on Zero
Running on Zero
Bot commited on
Commit ·
c7fba6e
1
Parent(s): db89e8d
Add traceback logging to debug generation errors
Browse files
app.py
CHANGED
|
@@ -215,6 +215,9 @@ def gradio_interface(question, schema):
|
|
| 215 |
_model.to(device)
|
| 216 |
sql = generate_sql_text(question, schema, device=device)
|
| 217 |
except Exception as e:
|
|
|
|
|
|
|
|
|
|
| 218 |
# result_output is a gr.JSON component: it always requires a
|
| 219 |
# JSON-serializable value, never a bare string, or it crashes with
|
| 220 |
# "Invalid JSON string" -- confirmed via server logs to be exactly
|
|
|
|
| 215 |
_model.to(device)
|
| 216 |
sql = generate_sql_text(question, schema, device=device)
|
| 217 |
except Exception as e:
|
| 218 |
+
import traceback
|
| 219 |
+
print(f"gradio_interface generation error: {e}")
|
| 220 |
+
traceback.print_exc()
|
| 221 |
# result_output is a gr.JSON component: it always requires a
|
| 222 |
# JSON-serializable value, never a bare string, or it crashes with
|
| 223 |
# "Invalid JSON string" -- confirmed via server logs to be exactly
|