Commit ·
a804809
1
Parent(s): d8779d7
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,12 +102,10 @@ if st.button("Generate Presentation"):
|
|
| 102 |
presentation_filename = f"{presentation_title}.pptx"
|
| 103 |
prs.save(presentation_filename)
|
| 104 |
|
| 105 |
-
# Provide a
|
| 106 |
with open(presentation_filename, "rb") as file:
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
f"(data:application/octet-stream;base64,{base64.b64encode(file.read()).decode()})"
|
| 110 |
-
)
|
| 111 |
except json.JSONDecodeError as e:
|
| 112 |
st.error("Error parsing JSON response from OpenAI.")
|
| 113 |
else:
|
|
|
|
| 102 |
presentation_filename = f"{presentation_title}.pptx"
|
| 103 |
prs.save(presentation_filename)
|
| 104 |
|
| 105 |
+
# Provide a styled download button
|
| 106 |
with open(presentation_filename, "rb") as file:
|
| 107 |
+
download_button = f'<a href="data:application/octet-stream;base64,{base64.b64encode(file.read()).decode()}" download="{presentation_filename}" class="st-eb stButton stButton-primary">Download {presentation_title}</a>'
|
| 108 |
+
st.markdown(download_button, unsafe_allow_html=True)
|
|
|
|
|
|
|
| 109 |
except json.JSONDecodeError as e:
|
| 110 |
st.error("Error parsing JSON response from OpenAI.")
|
| 111 |
else:
|