Kuberwastaken commited on
Commit
5d3df5a
·
1 Parent(s): 02b8759

Going back to older version

Browse files
Files changed (2) hide show
  1. main.py +4 -3
  2. prompts.yaml +10 -10
main.py CHANGED
@@ -18,12 +18,13 @@ def process_resume(input_method, resume_text, pdf_file):
18
  else:
19
  if pdf_file is None:
20
  return "No PDF uploaded."
21
- # Check if pdf_file is a string (i.e. a file path) or a file-like object
22
  if isinstance(pdf_file, str):
23
  with open(pdf_file, "rb") as f:
24
  file_bytes = f.read()
25
  else:
26
  file_bytes = pdf_file.read()
 
27
  file_obj = io.BytesIO(file_bytes)
28
  text = extract_text_from_pdf(file_obj)
29
 
@@ -31,11 +32,11 @@ def process_resume(input_method, resume_text, pdf_file):
31
  return "No resume text found."
32
 
33
  agent = create_agent()
34
- # Instruct the agent to roast the resume using the resume text.
 
35
  response = agent.run(f"Roast this resume: {text}")
36
  return response
37
 
38
-
39
  def toggle_inputs(method):
40
  if method == "Text":
41
  return gr.update(visible=True), gr.update(visible=False)
 
18
  else:
19
  if pdf_file is None:
20
  return "No PDF uploaded."
21
+ # pdf_file may be a file path or a file-like object; handle accordingly
22
  if isinstance(pdf_file, str):
23
  with open(pdf_file, "rb") as f:
24
  file_bytes = f.read()
25
  else:
26
  file_bytes = pdf_file.read()
27
+ import io
28
  file_obj = io.BytesIO(file_bytes)
29
  text = extract_text_from_pdf(file_obj)
30
 
 
32
  return "No resume text found."
33
 
34
  agent = create_agent()
35
+ # Directly run the agent to roast the resume. With our updated prompts,
36
+ # the agent should output plain text that we can simply print.
37
  response = agent.run(f"Roast this resume: {text}")
38
  return response
39
 
 
40
  def toggle_inputs(method):
41
  if method == "Text":
42
  return gr.update(visible=True), gr.update(visible=False)
prompts.yaml CHANGED
@@ -1,16 +1,16 @@
1
  system_prompt: |
2
- You are a witty professional roaster who analyzes resumes.
3
- Your job is to create a humorous, professional roast of a resume.
4
- Focus on teasing overly verbose descriptions, excessive buzzwords, and generic statements,
5
- while keeping the tone light and appropriate for a professional setting.
6
 
7
  task_prompt: |
8
- Using the provided resume details, craft a roast that:
9
- 1. References key sections such as Summary, Experience, Education, and Skills.
10
- 2. Is humorous but not mean-spirited.
11
- 3. Maintains a professional tone.
12
- 4. Adds creative flair that makes the roast both entertaining and insightful.
13
 
14
  final_answer:
15
- pre_messages: "Final Roast:"
16
  post_messages: ""
 
 
1
  system_prompt: |
2
+ You are a witty professional roaster who roasts resumes.
3
+ Your job is to create a humorous roast of a resume based solely on its content.
4
+ Keep the tone light, semi-professional, and extremely entertaining, with puns and jokes.
5
+ Add Meta jokes for Resume being too big, too short, other improvements and roasting if there is something funny on there, like casual buzzwords.
6
 
7
  task_prompt: |
8
+ Given the provided resume details, craft a roast that:
9
+ 1. References key sections such as Education, Projects, and Skills.
10
+ 2. Is humorous yet semi-professional.
11
+ 3. Outputs plain text without any code formatting.
 
12
 
13
  final_answer:
14
+ pre_messages: "Final Roast: "
15
  post_messages: ""
16
+ instructions: "Output your final roast as plain text with no code blocks."