FrederickSundeep commited on
Commit
afbc727
·
1 Parent(s): c972896

issue fixed 002

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -318,9 +318,6 @@ def chat_stream_doc():
318
  # ✅ Extract filenames and code from reply
319
  file_pattern = r"### File: (.+?)\n```(.*?)```"
320
  matches = re.finditer(file_pattern, reply, re.DOTALL)
321
- for match in matches:
322
- filename = match.group(1).strip()
323
- code = match.group(2).strip()
324
 
325
  if not matches:
326
  return jsonify({"error": "No files found in generated output."}), 500
@@ -328,8 +325,8 @@ def chat_stream_doc():
328
  zip_buffer = BytesIO()
329
  with zipfile.ZipFile(zip_buffer, "w", zipfile.ZIP_DEFLATED) as zipf:
330
  for match in matches:
331
- name = match.group("name").strip()
332
- code = match.group("code").strip()
333
  zipf.writestr(name, code)
334
 
335
  zip_buffer.seek(0)
 
318
  # ✅ Extract filenames and code from reply
319
  file_pattern = r"### File: (.+?)\n```(.*?)```"
320
  matches = re.finditer(file_pattern, reply, re.DOTALL)
 
 
 
321
 
322
  if not matches:
323
  return jsonify({"error": "No files found in generated output."}), 500
 
325
  zip_buffer = BytesIO()
326
  with zipfile.ZipFile(zip_buffer, "w", zipfile.ZIP_DEFLATED) as zipf:
327
  for match in matches:
328
+ name = match.group(1).strip()
329
+ code = match.group(2).strip()
330
  zipf.writestr(name, code)
331
 
332
  zip_buffer.seek(0)