From d29c6c955d93cd4bc7cdf1b6260dae74c21c070c Mon Sep 17 00:00:00 2001 From: Rashmi BS Date: Fri, 9 Jan 2026 20:06:44 +0530 Subject: [PATCH 1/2] updated the instructions and optimised the code - removed redundant if else --- advanced_llm_apps/resume_job_matcher/app.py | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/advanced_llm_apps/resume_job_matcher/app.py b/advanced_llm_apps/resume_job_matcher/app.py index aa11af6..310bb29 100644 --- a/advanced_llm_apps/resume_job_matcher/app.py +++ b/advanced_llm_apps/resume_job_matcher/app.py @@ -9,7 +9,11 @@ st.title("📄 Resume & Job Matcher") st.sidebar.info(""" This app uses a local LLM via **Ollama**. 1. Install Ollama: https://ollama.ai -2. Run a model (e.g., `ollama run llama3`). +2. Verify the ollama CLI works, by running the below commands in your terminal: + 2.1. Start the Ollama server: `ollama serve` on seperate terminal. + 2.2. Run a model (e.g., `ollama pull llama3`). + 2.3. Verify local LLM llama is listed using `ollama list`. + 2.4. Run the streamlit run app.py command to start this app in another terminal. 3. Upload a Resume + Job Description to get a fit score and suggestions. """) @@ -21,23 +25,23 @@ def extract_pdf_text(file): text += page.get_text() return text +def check_file_type(file_name) -> str: + if file_name.type == "application/pdf": + file_text = extract_pdf_text(file_name) + else: + file_text = file_name.read().decode("utf-8") + return file_text + # File uploaders resume_file = st.file_uploader("Upload Resume (PDF/TXT)", type=["pdf", "txt"]) job_file = st.file_uploader("Upload Job Description (PDF/TXT)", type=["pdf", "txt"]) if st.button("🔍 Match Resume with Job Description"): + # Extract Resume text + resume_text = check_file_type(resume_file) + # Extract Job Description text + job_text = check_file_type(job_file) if resume_file and job_file: - # Extract Resume text - if resume_file.type == "application/pdf": - resume_text = extract_pdf_text(resume_file) - else: - resume_text = resume_file.read().decode("utf-8") - - # Extract Job text - if job_file.type == "application/pdf": - job_text = extract_pdf_text(job_file) - else: - job_text = job_file.read().decode("utf-8") # Prompt prompt = f""" From 6fdb1ac70cca34e562fc77724cb918503626560d Mon Sep 17 00:00:00 2001 From: Rashmi BS Date: Sun, 11 Jan 2026 23:40:22 +0530 Subject: [PATCH 2/2] review comments addressed --- advanced_llm_apps/resume_job_matcher/app.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/advanced_llm_apps/resume_job_matcher/app.py b/advanced_llm_apps/resume_job_matcher/app.py index 310bb29..2dccf39 100644 --- a/advanced_llm_apps/resume_job_matcher/app.py +++ b/advanced_llm_apps/resume_job_matcher/app.py @@ -10,9 +10,9 @@ st.sidebar.info(""" This app uses a local LLM via **Ollama**. 1. Install Ollama: https://ollama.ai 2. Verify the ollama CLI works, by running the below commands in your terminal: - 2.1. Start the Ollama server: `ollama serve` on seperate terminal. + 2.1. Start the Ollama server: `ollama serve` on separate terminal. 2.2. Run a model (e.g., `ollama pull llama3`). - 2.3. Verify local LLM llama is listed using `ollama list`. + 2.3. Verify local LLM llama is listed using `ollama list`. 2.4. Run the streamlit run app.py command to start this app in another terminal. 3. Upload a Resume + Job Description to get a fit score and suggestions. """) @@ -25,7 +25,7 @@ def extract_pdf_text(file): text += page.get_text() return text -def check_file_type(file_name) -> str: +def get_text_from_file(file_name) -> str: if file_name.type == "application/pdf": file_text = extract_pdf_text(file_name) else: @@ -37,11 +37,12 @@ resume_file = st.file_uploader("Upload Resume (PDF/TXT)", type=["pdf", "txt"]) job_file = st.file_uploader("Upload Job Description (PDF/TXT)", type=["pdf", "txt"]) if st.button("🔍 Match Resume with Job Description"): - # Extract Resume text - resume_text = check_file_type(resume_file) - # Extract Job Description text - job_text = check_file_type(job_file) if resume_file and job_file: + # Extract Resume text + resume_text = get_text_from_file(resume_file) + # Extract Job Description text + job_text = get_text_from_file(job_file) + # Prompt prompt = f"""