cdcvd commited on
Commit
60e2f90
·
verified ·
1 Parent(s): e2e336e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -70,7 +70,10 @@ def process_files(resume_file, job_description_file):
70
  json.dump(output, tmp_file, ensure_ascii=False, indent=4)
71
  return tmp_file.name
72
  except Exception as e:
73
- return {"error": str(e)}
 
 
 
74
 
75
  iface = gr.Interface(
76
  fn=process_files,
 
70
  json.dump(output, tmp_file, ensure_ascii=False, indent=4)
71
  return tmp_file.name
72
  except Exception as e:
73
+ # ایجاد یک فایل متنی موقت برای پیام خطا
74
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".txt", mode='w', encoding='utf-8') as tmp_file:
75
+ tmp_file.write(f"Error: {str(e)}")
76
+ return tmp_file.name
77
 
78
  iface = gr.Interface(
79
  fn=process_files,