Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -93,10 +93,18 @@ if resume_text and job_description:
|
|
93 |
|
94 |
try:
|
95 |
# Initialize the Generative Model
|
96 |
-
model = genai.GenerativeModel(model='gemini-pro')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
# Generate content using the model
|
99 |
-
response = model.generate(prompt=prompt, temperature=0.0, max_output_tokens=500)
|
100 |
|
101 |
# Validate and enforce format consistency
|
102 |
expected_format = r"(1\. \*\*Match Score:\*\* .+\n2\. \*\*Justification:\*\* .+\n3\. \*\*Resume Suggestions:\*\* .+\n4\. \*\*Interview Preparation Topics:\*\* .+)"
|
|
|
93 |
|
94 |
try:
|
95 |
# Initialize the Generative Model
|
96 |
+
#model = genai.GenerativeModel(model='gemini-pro')
|
97 |
+
model = genai.GenerativeModel("gemini-pro")
|
98 |
+
|
99 |
+
response = model.generate_content(
|
100 |
+
prompt=prompt,
|
101 |
+
generation_config=genai.types.GenerationConfig(
|
102 |
+
temperature=0.0, # Ensures deterministic output
|
103 |
+
max_output_tokens=500, # Limits the response length to 500 tokens
|
104 |
+
candidate_count=1 # Generates only one candidate
|
105 |
+
)
|
106 |
+
)
|
107 |
|
|
|
|
|
108 |
|
109 |
# Validate and enforce format consistency
|
110 |
expected_format = r"(1\. \*\*Match Score:\*\* .+\n2\. \*\*Justification:\*\* .+\n3\. \*\*Resume Suggestions:\*\* .+\n4\. \*\*Interview Preparation Topics:\*\* .+)"
|