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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -61,8 +61,17 @@ def main(resume_text, job_description):
61
 
62
  def process_files(resume_file, job_description_file):
63
  try:
64
- resume_text = resume_file.read().decode('utf-8')
65
- job_description = job_description_file.read().decode('utf-8')
 
 
 
 
 
 
 
 
 
66
 
67
  output = main(resume_text, job_description)
68
 
 
61
 
62
  def process_files(resume_file, job_description_file):
63
  try:
64
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".txt") as tmp_resume_file:
65
+ tmp_resume_file.write(resume_file.read())
66
+ tmp_resume_file.flush()
67
+ with open(tmp_resume_file.name, 'r', encoding='utf-8') as f:
68
+ resume_text = f.read()
69
+
70
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".txt") as tmp_job_file:
71
+ tmp_job_file.write(job_description_file.read())
72
+ tmp_job_file.flush()
73
+ with open(tmp_job_file.name, 'r', encoding='utf-8') as f:
74
+ job_description = f.read()
75
 
76
  output = main(resume_text, job_description)
77