Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 15 |
-
temp_path =
|
| 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 |
-
#
|
| 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)
|