Spaces:
Running
Running
Fix: serialize structured_data and trace as JSON strings in dataset traces
Browse files
app.py
CHANGED
|
@@ -208,8 +208,8 @@ def _push_trace(question: str, answer: str, trace: list, structured_data=None) -
|
|
| 208 |
"timestamp": datetime.datetime.utcnow().isoformat() + "Z",
|
| 209 |
"question": question,
|
| 210 |
"answer": answer,
|
| 211 |
-
"structured_data": structured_data,
|
| 212 |
-
"trace": trace,
|
| 213 |
"model": "Qwen2.5-3B-Instruct (llama.cpp Q4_K_M)",
|
| 214 |
}
|
| 215 |
fname = f"traces/trace_{datetime.datetime.utcnow().strftime('%Y%m%d_%H%M%S_%f')}.json"
|
|
|
|
| 208 |
"timestamp": datetime.datetime.utcnow().isoformat() + "Z",
|
| 209 |
"question": question,
|
| 210 |
"answer": answer,
|
| 211 |
+
"structured_data": json.dumps(structured_data) if structured_data else None,
|
| 212 |
+
"trace": json.dumps(trace),
|
| 213 |
"model": "Qwen2.5-3B-Instruct (llama.cpp Q4_K_M)",
|
| 214 |
}
|
| 215 |
fname = f"traces/trace_{datetime.datetime.utcnow().strftime('%Y%m%d_%H%M%S_%f')}.json"
|