Spaces:
Sleeping
Sleeping
Download app.py from Mairu10/ATS_RESUME: direct link, hf CLI and curl.
- Browser
- Download file 3.35 kB
-
https://huggingface.co/spaces/Mairu10/ATS_RESUME/resolve/main/app.py
- Command line
-
hf download hf://spaces/Mairu10/ATS_RESUME/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Mairu10/ATS_RESUME/resolve/main/app.py
3.35 kB
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| from PyPDF2 import PdfReader | |
| # Initialize the Inference Client | |
| client = InferenceClient("HuggingFaceH4/zephyr-7b-beta") | |
| def extract_text_from_pdf(file): | |
| if file is None: | |
| return "" | |
| reader = PdfReader(file) | |
| text = "" | |
| for page in reader.pages: | |
| text += page.extract_text() | |
| return text | |
| def ats_friendly_checker(file): | |
| resume_text = extract_text_from_pdf(file) | |
| system_message = "Evaluate the following resume for ATS-friendliness and provide feedback." | |
| message = resume_text | |
| response = client.chat_completion( | |
| [{"role": "system", "content": system_message}, {"role": "user", "content": message}], | |
| max_tokens=512, | |
| temperature=0.7, | |
| top_p=0.95 | |
| ).choices[0].message.content | |
| feedback = response | |
| return feedback | |
| def resume_match_checker(file, job_description): | |
| resume_text = extract_text_from_pdf(file) | |
| system_message = "Compare the following resume with the job description and provide feedback." | |
| message = f"Resume: {resume_text}\n\nJob Description: {job_description}" | |
| response = client.chat_completion( | |
| [{"role": "system", "content": system_message}, {"role": "user", "content": message}], | |
| max_tokens=512, | |
| temperature=0.7, | |
| top_p=0.95 | |
| ).choices[0].message.content | |
| feedback = response | |
| return feedback | |
| def resume_quality_score(file): | |
| resume_text = extract_text_from_pdf(file) | |
| system_message = "Evaluate the following resume for overall quality and provide feedback." | |
| message = resume_text | |
| response = client.chat_completion( | |
| [{"role": "system", "content": system_message}, {"role": "user", "content": message}], | |
| max_tokens=512, | |
| temperature=0.7, | |
| top_p=0.95 | |
| ).choices[0].message.content | |
| interpretation = response | |
| return interpretation | |
| with gr.Blocks() as demo: | |
| gr.Markdown(""" | |
| # Resume Enhancement Tool π | |
| Welcome to the Resume Enhancement Tool! This tool offers several features to help you enhance your resume, ensuring it's ATS-friendly, matches job descriptions, and is of high quality. You can also convert your resume text to Overleaf code for a polished, professional look. | |
| """) | |
| with gr.Tab("ATS-Friendly π"): | |
| with gr.Row(): | |
| resume = gr.File(label="Upload your Resume (PDF)") | |
| feedback = gr.Textbox(label="Feedback", interactive=False, lines=15, max_lines=50) | |
| resume.upload(ats_friendly_checker, resume, feedback) | |
| with gr.Tab("Resume Match π"): | |
| with gr.Row(): | |
| resume = gr.File(label="Upload your Resume (PDF)") | |
| job_description = gr.Textbox(label="Job Description", lines=15) | |
| feedback = gr.Textbox(label="Feedback", interactive=False, lines=15, max_lines=50) | |
| gr.Button("Check Match").click(resume_match_checker, [resume, job_description], feedback) | |
| with gr.Tab("Resume Quality π"): | |
| with gr.Row(): | |
| resume = gr.File(label="Upload your Resume (PDF)") | |
| interpretation = gr.Textbox(label="Interpretation", interactive=False, lines=15, max_lines=50) | |
| resume.upload(resume_quality_score, resume, interpretation) | |
| if __name__ == "__main__": | |
| demo.launch(share=True) | |