Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,9 +6,16 @@ import os
|
|
| 6 |
import google.generativeai as genai
|
| 7 |
|
| 8 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
## function to load Gemini Pro model and get repsonses
|
| 11 |
-
model=genai.GenerativeModel("gemini-pro"
|
|
|
|
| 12 |
chat = model.start_chat(history=[])
|
| 13 |
def get_gemini_response(question):
|
| 14 |
|
|
|
|
| 6 |
import google.generativeai as genai
|
| 7 |
|
| 8 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
| 9 |
+
generation_config = {
|
| 10 |
+
"temperature": 0,
|
| 11 |
+
"top_p": 1,
|
| 12 |
+
"top_k": 1,
|
| 13 |
+
"max_output_tokens": 2048,
|
| 14 |
+
}
|
| 15 |
|
| 16 |
## function to load Gemini Pro model and get repsonses
|
| 17 |
+
model = genai.GenerativeModel(model_name="gemini-pro",
|
| 18 |
+
generation_config=generation_config)
|
| 19 |
chat = model.start_chat(history=[])
|
| 20 |
def get_gemini_response(question):
|
| 21 |
|