hruday96 commited on
Commit
22b0e65
·
verified ·
1 Parent(s): fcea9f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
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:\*\* .+)"