Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -253,15 +253,7 @@ Follow this example structure:
|
|
253 |
system_instruction=system_prompt
|
254 |
)
|
255 |
|
256 |
-
|
257 |
-
response = await model.generate_content_async(messages)
|
258 |
-
except Exception as e:
|
259 |
-
if "API key not valid" in str(e):
|
260 |
-
gr.Error("Invalid API key. Please provide a valid Gemini API key.")
|
261 |
-
raise ValueError("Invalid API key. Please provide a valid Gemini API key.")
|
262 |
-
else:
|
263 |
-
gr.Error(f"Failed to generate podcast script: {e}")
|
264 |
-
raise e
|
265 |
|
266 |
print(f"Generated podcast script:\n{response.text}")
|
267 |
|
|
|
253 |
system_instruction=system_prompt
|
254 |
)
|
255 |
|
256 |
+
response = await model.generate_content_async(messages)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
print(f"Generated podcast script:\n{response.text}")
|
259 |
|