saima730 commited on
Commit
7d746a2
1 Parent(s): 5ab1003

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -1,7 +1,6 @@
1
  # Install necessary packages
2
  !pip install streamlit transformers diffusers gtts moviepy safetensors torch gradio
3
 
4
- # Import libraries
5
  import streamlit as st
6
  import torch
7
  from transformers import pipeline
@@ -65,11 +64,10 @@ prompt = st.text_input("Enter your prompt here:")
65
  if st.button("Generate Video"):
66
  if prompt:
67
  st.write("Generating video, please wait...")
68
-
69
- # Generate the video
70
  video_path = generate_educational_video(prompt)
71
-
72
- # Display the video in Streamlit
73
- st.video(video_path)
 
74
  else:
75
  st.warning("Please enter a prompt.")
 
1
  # Install necessary packages
2
  !pip install streamlit transformers diffusers gtts moviepy safetensors torch gradio
3
 
 
4
  import streamlit as st
5
  import torch
6
  from transformers import pipeline
 
64
  if st.button("Generate Video"):
65
  if prompt:
66
  st.write("Generating video, please wait...")
 
 
67
  video_path = generate_educational_video(prompt)
68
+ if os.path.exists(video_path):
69
+ st.video(video_path)
70
+ else:
71
+ st.write("Video generation failed.")
72
  else:
73
  st.warning("Please enter a prompt.")