muhammadsalmanalfaridzi commited on
Commit
46fc669
·
verified ·
1 Parent(s): 98e28e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -88,10 +88,17 @@ def process_resume(resume, jd_string):
88
  """
89
  Process the uploaded resume and job description, optimize it, and return the result.
90
  """
91
- # Convert file to Markdown using MarkItDown
92
- result = md_converter.convert(resume.name)
93
- resume_string = result.text_content # Get the converted Markdown content
94
-
 
 
 
 
 
 
 
95
  # Create optimization prompt
96
  prompt = create_prompt(resume_string, jd_string)
97
 
 
88
  """
89
  Process the uploaded resume and job description, optimize it, and return the result.
90
  """
91
+ # Supported file extensions
92
+ supported_extensions = ('.pptx', '.docx', '.pdf', '.jpg', '.jpeg', '.png', '.xlsx')
93
+
94
+ # Check if the uploaded resume has a supported extension
95
+ if resume.name.lower().endswith(supported_extensions):
96
+ # Convert file to Markdown using MarkItDown
97
+ result = md_converter.convert(resume.name)
98
+ resume_string = result.text_content # Get the converted Markdown content
99
+ else:
100
+ return "File format not supported for conversion to Markdown."
101
+
102
  # Create optimization prompt
103
  prompt = create_prompt(resume_string, jd_string)
104