LLMTWO / tailor.py
XaKnee's picture
Update tailor.py
c06b859 verified
raw
history blame contribute delete
553 Bytes
from model_loader import load_model
model = load_model()
def tailor_resume(resume, job_description):
prompt = f"""
You are an AI resume assistant. Your job is to tailor this resume to the job description below.
Resume:
{resume}
Job Description:
{job_description}
Tailored Resume:
"""
# Truncate to fit distilgpt2 token limit (~1024 tokens = ~4000 characters)
if len(prompt) > 3500:
prompt = prompt[:3500]
response = model(prompt, max_new_tokens=300)[0]
return response[0]["generated_text"]