Spaces:
Build error
Build error
Paul Ke commited on
Update streamlit_app.py
Browse files- streamlit_app.py +11 -11
streamlit_app.py
CHANGED
|
@@ -186,14 +186,14 @@ if st.button('Generate the story'):
|
|
| 186 |
except Exception as error:
|
| 187 |
st.sidebar.error(f"An error occurred: {error}")
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
|
|
|
| 186 |
except Exception as error:
|
| 187 |
st.sidebar.error(f"An error occurred: {error}")
|
| 188 |
|
| 189 |
+
try:
|
| 190 |
+
video_file = open(st.session_state["videos"], "rb")
|
| 191 |
+
st.download_button(
|
| 192 |
+
"**Download Video π**",
|
| 193 |
+
data=video_file,
|
| 194 |
+
file_name=f"{st.session_state['videos'].lower().translate(str.maketrans('', '', string.punctuation)).replace(' ', '_')}.mp4",
|
| 195 |
+
mime="video/mp4",
|
| 196 |
+
type="primary",
|
| 197 |
+
)
|
| 198 |
+
except Exception as e:
|
| 199 |
+
st.error("Failed downloading the video", icon="π")
|