Spaces:
Running
Running
Commit
•
f6d566a
1
Parent(s):
279ca60
Update app.py
Browse files
app.py
CHANGED
@@ -50,8 +50,13 @@ def main():
|
|
50 |
response = generate_gemini_content(prompt, model_name=model_name)
|
51 |
|
52 |
# Display the generated content in Markdown format
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
if __name__ == "__main__":
|
57 |
main()
|
|
|
50 |
response = generate_gemini_content(prompt, model_name=model_name)
|
51 |
|
52 |
# Display the generated content in Markdown format
|
53 |
+
if response.candidates:
|
54 |
+
# Check if candidates are available
|
55 |
+
parts = response.candidates[0].content.parts
|
56 |
+
generated_text = parts[0].text if parts else "No content generated."
|
57 |
+
st.markdown(to_markdown(generated_text))
|
58 |
+
else:
|
59 |
+
st.warning("No candidates found in the response.")
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
main()
|