bainskarman commited on
Commit
81578be
·
verified ·
1 Parent(s): 7e4deac

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +12 -15
model.py CHANGED
@@ -1,22 +1,19 @@
1
- import google.generativeai as genai
2
  import os
3
  from dotenv import load_dotenv
4
- from convert import ExtractPDFText
5
- load_dotenv()
6
-
7
- genai.configure(api_key = os.environ["GOOGLE_API_KEY"])
8
-
9
- model = genai.GenerativeModel("gemini-pro")
10
 
11
- def modelFeedback(ats_score,resume_data):
 
 
12
 
 
13
  input_prompt = f"""
14
- You are now an ATS Score analyzer and given ATS Score is {int(ats_score*100)}%.
15
- Your task is to provide feedback to the user based on the ATS score.
16
- print ATS score first. mention where resume is good and where resume lacks.
17
- talk about each section of user's resume and talk good and bad points of it.
 
18
  """
19
- response = model.generate_content([input_prompt,resume_data],stream=True)
20
- response.resolve()
21
-
22
  return response
 
 
1
  import os
2
  from dotenv import load_dotenv
3
+ from transformers import pipeline
 
 
 
 
 
4
 
5
+ load_dotenv()
6
+ model_name = "gpt2"
7
+ generator = pipeline("text-generation", model=model_name)
8
 
9
+ def modelFeedback(ats_score, resume_data):
10
  input_prompt = f"""
11
+ You are now an ATS Score analyzer and given ATS Score is {int(ats_score * 100)}%.
12
+ Your task is to provide feedback to the user based on the ATS score.
13
+ Print ATS score first. Mention where the resume is good and where the resume lacks.
14
+ Talk about each section of the user's resume and talk about good and bad points of it.
15
+ Resume Data: {resume_data}
16
  """
17
+ response = generator(input_prompt, max_length=500, num_return_sequences=1)[0]['generated_text']
18
+
 
19
  return response