DreamStream-1 commited on
Commit
b415874
·
verified ·
1 Parent(s): 7ef4180

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -52,6 +52,7 @@ def extract_entities_via_gemini(resume_text):
52
  return {"name": "John Doe", "email": "john.doe@example.com", "contact": "123-456-7890"}
53
 
54
  def save_results_to_csv(results):
 
55
  csv_file_path = "/tmp/results.csv"
56
  with open(csv_file_path, mode='w', newline='') as file:
57
  writer = csv.writer(file)
@@ -111,6 +112,7 @@ def check_similarity(job_description, resume_files):
111
  contact_info.get('contact', 'No Contact')
112
  ))
113
 
 
114
  csv_file_path = save_results_to_csv(results)
115
  return results, csv_file_path
116
 
@@ -128,7 +130,7 @@ with gr.Blocks() as demo:
128
  check_button.click(
129
  check_similarity,
130
  inputs=[job_desc_input, resume_input],
131
- outputs=[results_output, gr.File(label="Download CSV", value=lambda: save_results_to_csv(results_output))]
132
  )
133
 
134
  demo.launch()
 
52
  return {"name": "John Doe", "email": "john.doe@example.com", "contact": "123-456-7890"}
53
 
54
  def save_results_to_csv(results):
55
+ # Save the results to a CSV file and return the file path
56
  csv_file_path = "/tmp/results.csv"
57
  with open(csv_file_path, mode='w', newline='') as file:
58
  writer = csv.writer(file)
 
112
  contact_info.get('contact', 'No Contact')
113
  ))
114
 
115
+ # Return results and the path to the CSV file
116
  csv_file_path = save_results_to_csv(results)
117
  return results, csv_file_path
118
 
 
130
  check_button.click(
131
  check_similarity,
132
  inputs=[job_desc_input, resume_input],
133
+ outputs=[results_output, gr.File(label="Download CSV")]
134
  )
135
 
136
  demo.launch()