ATSScanner / model.py
bainskarman's picture
Update model.py
81578be verified
raw
history blame
741 Bytes
import os
from dotenv import load_dotenv
from transformers import pipeline
load_dotenv()
model_name = "gpt2"
generator = pipeline("text-generation", model=model_name)
def modelFeedback(ats_score, resume_data):
input_prompt = f"""
You are now an ATS Score analyzer and given ATS Score is {int(ats_score * 100)}%.
Your task is to provide feedback to the user based on the ATS score.
Print ATS score first. Mention where the resume is good and where the resume lacks.
Talk about each section of the user's resume and talk about good and bad points of it.
Resume Data: {resume_data}
"""
response = generator(input_prompt, max_length=500, num_return_sequences=1)[0]['generated_text']
return response