Saqib
commited on
Commit
•
8572610
1
Parent(s):
f5a03b1
Update app.py
Browse files
app.py
CHANGED
@@ -105,16 +105,16 @@ def main(api_key, user_query):
|
|
105 |
try:
|
106 |
# Initialize the Google Gemini model with the provided API key
|
107 |
genai.configure(api_key=api_key)
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
model = genai.GenerativeModel(
|
116 |
model_name="gemini-1.5-flash-exp-0827",
|
117 |
-
|
118 |
)
|
119 |
except Exception as e:
|
120 |
return f"Failed to initialize Google Gemini model. Error: {str(e)}", ""
|
|
|
105 |
try:
|
106 |
# Initialize the Google Gemini model with the provided API key
|
107 |
genai.configure(api_key=api_key)
|
108 |
+
generation_config = {
|
109 |
+
# "temperature": 0.2,
|
110 |
+
# "top_p": 0.95,
|
111 |
+
# "top_k": 64,
|
112 |
+
# "max_output_tokens": 8192,
|
113 |
+
"response_mime_type": "application/json",
|
114 |
+
}
|
115 |
model = genai.GenerativeModel(
|
116 |
model_name="gemini-1.5-flash-exp-0827",
|
117 |
+
generation_config=generation_config,
|
118 |
)
|
119 |
except Exception as e:
|
120 |
return f"Failed to initialize Google Gemini model. Error: {str(e)}", ""
|