muhammadsalmanalfaridzi commited on
Commit
430da15
·
verified ·
1 Parent(s): 888d73b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -101,7 +101,7 @@ def process_resume(resume, jd_string):
101
  response_list = response_string.split("## Additional Suggestions")
102
 
103
  # Extract new resume and suggestions for improvement
104
- new_resume = response_list[0].strip()
105
  suggestions = "## Additional Suggestions \n\n" + response_list[1].strip() if len(response_list) > 1 else ""
106
 
107
  # Save the optimized resume
@@ -110,10 +110,14 @@ def process_resume(resume, jd_string):
110
  with open(optimized_file_path, "w", encoding="utf-8") as f:
111
  f.write(new_resume)
112
 
113
- # Return the results
114
- return resume_string, new_resume, optimized_file_path, suggestions
 
 
 
 
115
  except Exception as e:
116
- return f"Error processing file: {str(e)}", "", None, ""
117
 
118
  def export_resume(new_resume):
119
  """
 
101
  response_list = response_string.split("## Additional Suggestions")
102
 
103
  # Extract new resume and suggestions for improvement
104
+ new_resume = response_list[0].strip() if len(response_list) > 0 else ""
105
  suggestions = "## Additional Suggestions \n\n" + response_list[1].strip() if len(response_list) > 1 else ""
106
 
107
  # Save the optimized resume
 
110
  with open(optimized_file_path, "w", encoding="utf-8") as f:
111
  f.write(new_resume)
112
 
113
+ # Prepare the download links
114
+ download_before = resume.name
115
+ download_after = optimized_file_path
116
+
117
+ # Return the results (ensure five outputs)
118
+ return resume_string, new_resume, download_before, download_after, suggestions
119
  except Exception as e:
120
+ return f"Error processing file: {str(e)}", "", "", "", ""
121
 
122
  def export_resume(new_resume):
123
  """