Spaces:
Running
Running
bainskarman
commited on
Update model.py
Browse files
model.py
CHANGED
@@ -1,22 +1,19 @@
|
|
1 |
-
import google.generativeai as genai
|
2 |
import os
|
3 |
from dotenv import load_dotenv
|
4 |
-
from
|
5 |
-
load_dotenv()
|
6 |
-
|
7 |
-
genai.configure(api_key = os.environ["GOOGLE_API_KEY"])
|
8 |
-
|
9 |
-
model = genai.GenerativeModel("gemini-pro")
|
10 |
|
11 |
-
|
|
|
|
|
12 |
|
|
|
13 |
input_prompt = f"""
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
"""
|
19 |
-
response =
|
20 |
-
|
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
|