Spaces:
Sleeping
Sleeping
Commit ·
867b429
1
Parent(s): fe1db2c
issue fixed 004
Browse files
app.py
CHANGED
|
@@ -351,9 +351,17 @@ def chat_stream_doc():
|
|
| 351 |
|
| 352 |
zip_buffer = BytesIO()
|
| 353 |
with zipfile.ZipFile(zip_buffer, "w", zipfile.ZIP_DEFLATED) as zipf:
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
|
| 358 |
zip_buffer.seek(0)
|
| 359 |
return Response(
|
|
|
|
| 351 |
|
| 352 |
zip_buffer = BytesIO()
|
| 353 |
with zipfile.ZipFile(zip_buffer, "w", zipfile.ZIP_DEFLATED) as zipf:
|
| 354 |
+
file_count = 0
|
| 355 |
+
for match in matches:
|
| 356 |
+
filename = match.group(1).strip()
|
| 357 |
+
code = match.group(2).strip()
|
| 358 |
+
zipf.writestr(filename, code)
|
| 359 |
+
file_count += 1
|
| 360 |
+
|
| 361 |
+
if file_count == 0:
|
| 362 |
+
print("⚠️ No files written to ZIP. Check LLM output format.")
|
| 363 |
+
print("LLM Reply:\n", reply)
|
| 364 |
+
return jsonify({"error": "No files found in generated output."}), 500
|
| 365 |
|
| 366 |
zip_buffer.seek(0)
|
| 367 |
return Response(
|