Upload tailor.py
Browse files
tailor.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def build_prompt(resume_text, jd_text):
|
| 2 |
+
return f"""You are an expert resume assistant.
|
| 3 |
+
Based on the job description below:
|
| 4 |
+
{jd_text}
|
| 5 |
+
|
| 6 |
+
And this candidate resume:
|
| 7 |
+
{resume_text}
|
| 8 |
+
|
| 9 |
+
Rewrite the resume to better match the job description.
|
| 10 |
+
- Highlight relevant experience.
|
| 11 |
+
- Add missing skills where appropriate.
|
| 12 |
+
- Keep the format natural and ATS-friendly.
|
| 13 |
+
"""
|
| 14 |
+
|
| 15 |
+
def tailor_resume(pipe, resume, jd):
|
| 16 |
+
prompt = build_prompt(resume, jd)
|
| 17 |
+
result = pipe(prompt, max_new_tokens=512, do_sample=True, temperature=0.7)
|
| 18 |
+
return result[0]["generated_text"]
|