import streamlit as st from model import extract_text_from_pdf, analyze_resume import os st.set_page_config(page_title="AI Resume Analyzer", layout="centered") st.title("📄 AI Resume Analyzer") st.write("Upload your resume (PDF) to analyze its ATS compatibility.") uploaded_file = st.file_uploader("Upload Resume (PDF)", type=["pdf"]) if uploaded_file is not None: # Save the uploaded file temp_path = os.path.join("/tmp", uploaded_file.name) # Use /tmp for Hugging Face compatibility with open(temp_path, "wb") as f: f.write(uploaded_file.getbuffer()) # Extract & Analyze Resume resume_text = extract_text_from_pdf(temp_path) analysis = analyze_resume(resume_text) # Display Results st.subheader("📝 Resume Analysis") st.write(f"**ATS Score:** {analysis['ats_score']}%") st.write(f"**Matched Skills:** {', '.join(analysis['matched_skills'])}") st.write(f"**Missing Skills:** {', '.join(analysis['missing_skills'])}") # Remove the file after processing (optional) os.remove(temp_path)