AlexanderKazakov commited on
Commit ·
0ae385b
1
Parent(s): 9ca6868
basic cover letter by GPT
Browse filesFiles changed (2)
12345678910111213141516171819202122232425from jinja2 import Environment, FileSystemLoader
from gradio_app.backend.ChatGptInteractor import ChatGptInteractor
with open('data/cv_data/resume.txt', 'r', encoding='utf-8') as f: resume = f.read().strip()
with open('data/cv_data/job_description.txt', 'r', encoding='utf-8') as f: job_description = f.read().strip()
env = Environment(loader=FileSystemLoader('job_app_helper'))template = env.get_template('cover_letter_template.j2')prompt = template.render(resume=resume, job_description=job_description)
with open('data/cv_data/prompt.txt', 'w', encoding='utf-8') as f: f.write(prompt)
cgi = ChatGptInteractor(model_name='gpt-4-1106-preview')result = cgi.chat_completion_simple(user_text=prompt)
with open('data/cv_data/cover_letter.txt', 'w', encoding='utf-8') as f: f.write(result)
12345678910111213141516171819Instructions: Write a cover letter for a job application given this data:
APPLICANT'S RESUME:```{{resume}}```
JOB DESCRIPTION:```{{job_description}}```
Use only simple English words. Don't write in a too formal style, don't be pretentious, don't be pathetic! Write a normal human letter without over-excitement and false artificial emotionsjob_app_helper/cover_letter.pyAdded+25
job_app_helper/cover_letter_template.j2Added+19