mutaibamohsin845 commited on
Commit
a4e50cf
Β·
verified Β·
1 Parent(s): f6f5864

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -7,16 +7,15 @@ st.set_page_config(page_title="AI Resume Analyzer", layout="centered")
7
  st.title("πŸ“„ AI Resume Analyzer")
8
  st.write("Upload your resume (PDF) to analyze its ATS compatibility.")
9
 
10
- # File Upload
11
  uploaded_file = st.file_uploader("Upload Resume (PDF)", type=["pdf"])
12
 
13
  if uploaded_file is not None:
14
- # Save File Temporarily
15
- temp_path = f"temp_{uploaded_file.name}"
16
  with open(temp_path, "wb") as f:
17
  f.write(uploaded_file.getbuffer())
18
 
19
- # Extract & Analyze
20
  resume_text = extract_text_from_pdf(temp_path)
21
  analysis = analyze_resume(resume_text)
22
 
@@ -26,5 +25,5 @@ if uploaded_file is not None:
26
  st.write(f"**Matched Skills:** {', '.join(analysis['matched_skills'])}")
27
  st.write(f"**Missing Skills:** {', '.join(analysis['missing_skills'])}")
28
 
29
- # Clean Up
30
  os.remove(temp_path)
 
7
  st.title("πŸ“„ AI Resume Analyzer")
8
  st.write("Upload your resume (PDF) to analyze its ATS compatibility.")
9
 
 
10
  uploaded_file = st.file_uploader("Upload Resume (PDF)", type=["pdf"])
11
 
12
  if uploaded_file is not None:
13
+ # Save the uploaded file
14
+ temp_path = os.path.join("/tmp", uploaded_file.name) # Use /tmp for Hugging Face compatibility
15
  with open(temp_path, "wb") as f:
16
  f.write(uploaded_file.getbuffer())
17
 
18
+ # Extract & Analyze Resume
19
  resume_text = extract_text_from_pdf(temp_path)
20
  analysis = analyze_resume(resume_text)
21
 
 
25
  st.write(f"**Matched Skills:** {', '.join(analysis['matched_skills'])}")
26
  st.write(f"**Missing Skills:** {', '.join(analysis['missing_skills'])}")
27
 
28
+ # Remove the file after processing (optional)
29
  os.remove(temp_path)