Paul Ke commited on
Commit
51901da
·
verified ·
1 Parent(s): 1576571

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +3 -6
streamlit_app.py CHANGED
@@ -171,11 +171,8 @@ if st.button('Generate the story'):
171
 
172
  try:
173
  with st.spinner("Generating the story of the video"):
174
- # Upload and process the video
175
- processed_video = open(st.session_state["videos"])
176
- while processed_video.state.name == "PROCESSING":
177
- time.sleep(1)
178
- processed_video = get_file(processed_video.name)
179
 
180
  # AI agent processing
181
  response = multimodal_Agent.run(analysis_prompt, videos=[processed_video], safety_settings=safety_settings)
@@ -188,7 +185,7 @@ if st.button('Generate the story'):
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",
 
171
 
172
  try:
173
  with st.spinner("Generating the story of the video"):
174
+ # Process the video
175
+ processed_video = get_file(st.session_state["videos"])
 
 
 
176
 
177
  # AI agent processing
178
  response = multimodal_Agent.run(analysis_prompt, videos=[processed_video], safety_settings=safety_settings)
 
185
 
186
  try:
187
  video_file = open(st.session_state["videos"], "rb")
188
+ st.sidebar.download_button(
189
  "**Download Video 📁**",
190
  data=video_file,
191
  file_name=f"{st.session_state['videos'].lower().translate(str.maketrans('', '', string.punctuation)).replace(' ', '_')}.mp4",