Update app.py
Browse files
app.py
CHANGED
|
@@ -226,10 +226,10 @@ with st.sidebar:
|
|
| 226 |
step=1
|
| 227 |
)
|
| 228 |
|
| 229 |
-
# API key input
|
| 230 |
api_key = "AIzaSyB93eoXaU48hrJ2hojk-2gQPj28dGVSIbQ"
|
| 231 |
|
| 232 |
-
# Configure Gemini
|
| 233 |
genai.configure(api_key=api_key)
|
| 234 |
|
| 235 |
# Create the model
|
|
@@ -258,7 +258,13 @@ if st.button("Generate"):
|
|
| 258 |
try:
|
| 259 |
response = model.generate_content(prompt)
|
| 260 |
output = response.text.strip()
|
| 261 |
-
|
| 262 |
st.success(f"Output: {output}")
|
| 263 |
except Exception as e:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
st.error(f"An error occurred: {str(e)}")
|
|
|
|
| 226 |
step=1
|
| 227 |
)
|
| 228 |
|
| 229 |
+
# API key input
|
| 230 |
api_key = "AIzaSyB93eoXaU48hrJ2hojk-2gQPj28dGVSIbQ"
|
| 231 |
|
| 232 |
+
# Configure Gemini
|
| 233 |
genai.configure(api_key=api_key)
|
| 234 |
|
| 235 |
# Create the model
|
|
|
|
| 258 |
try:
|
| 259 |
response = model.generate_content(prompt)
|
| 260 |
output = response.text.strip()
|
| 261 |
+
# Display result
|
| 262 |
st.success(f"Output: {output}")
|
| 263 |
except Exception as e:
|
| 264 |
+
api_key = "AIzaSyDNWizNQAA0UaflR5f_zTF6FcMSIA5D8RU"
|
| 265 |
+
genai.configure(api_key=api_key)
|
| 266 |
+
model = genai.GenerativeModel(
|
| 267 |
+
model_name=model_name,
|
| 268 |
+
generation_config=generation_config,
|
| 269 |
+
)
|
| 270 |
st.error(f"An error occurred: {str(e)}")
|