ShubhamD95 commited on
Commit
2ce2dbd
·
verified ·
1 Parent(s): dfb4653

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -30,13 +30,10 @@ def highlight_keywords(resume_text, matched):
30
  def extract_missing_keywords_with_llm(job_desc, resume_text):
31
  prompt = f"""
32
  Given the following job description and resume, list the important skills, tools, and concepts from the job description that are missing or weakly represented in the resume.
33
-
34
  Job Description:
35
  {job_desc}
36
-
37
  Resume:
38
  {resume_text}
39
-
40
  Only list the missing keywords as bullet points.
41
  """
42
  result = summarizer(prompt, max_new_tokens=300, do_sample=True)[0]
@@ -46,15 +43,11 @@ Only list the missing keywords as bullet points.
46
  def build_dynamic_prompt(job_desc, resume_text, analyze_with_jd):
47
  prompt = f"""
48
  Analyze the resume below and organize it into meaningful categories (e.g., Skills, Education, Work Experience, etc.).
49
-
50
  If a job description is provided, compare it against the resume and suggest improvements section by section.
51
-
52
  Job Description:
53
  {job_desc if analyze_with_jd else '[None provided]'}
54
-
55
  Resume:
56
  {resume_text}
57
-
58
  Return structured Markdown with headers for each section and improvement suggestions.
59
  """
60
  return prompt
@@ -86,9 +79,11 @@ def create_ui():
86
  analyze_checkbox = gr.Checkbox(label="Analyze with Job Description", value=True)
87
  job_desc = gr.Textbox(label="Job Description", lines=6, placeholder="Paste job description here...")
88
  resume_text = gr.Textbox(label="Resume Text", lines=16, placeholder="Paste resume content here...")
 
89
  with gr.Column():
90
  output_analysis = gr.Markdown(label="Resume Analysis and Suggestions")
91
 
 
92
  job_desc.change(fn=analyze_resume, inputs=[job_desc, resume_text, analyze_checkbox], outputs=output_analysis)
93
  resume_text.change(fn=analyze_resume, inputs=[job_desc, resume_text, analyze_checkbox], outputs=output_analysis)
94
 
 
30
  def extract_missing_keywords_with_llm(job_desc, resume_text):
31
  prompt = f"""
32
  Given the following job description and resume, list the important skills, tools, and concepts from the job description that are missing or weakly represented in the resume.
 
33
  Job Description:
34
  {job_desc}
 
35
  Resume:
36
  {resume_text}
 
37
  Only list the missing keywords as bullet points.
38
  """
39
  result = summarizer(prompt, max_new_tokens=300, do_sample=True)[0]
 
43
  def build_dynamic_prompt(job_desc, resume_text, analyze_with_jd):
44
  prompt = f"""
45
  Analyze the resume below and organize it into meaningful categories (e.g., Skills, Education, Work Experience, etc.).
 
46
  If a job description is provided, compare it against the resume and suggest improvements section by section.
 
47
  Job Description:
48
  {job_desc if analyze_with_jd else '[None provided]'}
 
49
  Resume:
50
  {resume_text}
 
51
  Return structured Markdown with headers for each section and improvement suggestions.
52
  """
53
  return prompt
 
79
  analyze_checkbox = gr.Checkbox(label="Analyze with Job Description", value=True)
80
  job_desc = gr.Textbox(label="Job Description", lines=6, placeholder="Paste job description here...")
81
  resume_text = gr.Textbox(label="Resume Text", lines=16, placeholder="Paste resume content here...")
82
+ submit_btn = gr.Button("Analyze Resume")
83
  with gr.Column():
84
  output_analysis = gr.Markdown(label="Resume Analysis and Suggestions")
85
 
86
+ submit_btn.click(fn=analyze_resume, inputs=[job_desc, resume_text, analyze_checkbox], outputs=output_analysis)
87
  job_desc.change(fn=analyze_resume, inputs=[job_desc, resume_text, analyze_checkbox], outputs=output_analysis)
88
  resume_text.change(fn=analyze_resume, inputs=[job_desc, resume_text, analyze_checkbox], outputs=output_analysis)
89