Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from moviepy.editor import VideoFileClip, concatenate_videoclips, AudioFileClip, CompositeAudioClip
|
| 2 |
import streamlit as st
|
| 3 |
import cv2
|
|
|
|
| 4 |
import base64
|
| 5 |
import io
|
| 6 |
import openai
|
|
@@ -153,6 +154,13 @@ def main():
|
|
| 153 |
}
|
| 154 |
prompt = "Customize your prompt based on the script type selected above and additional features added."
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
if uploaded_file is not None and st.button("START PROCESSING"):
|
| 157 |
with st.spinner("Processing..."):
|
| 158 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_file, 1)
|
|
|
|
| 1 |
from moviepy.editor import VideoFileClip, concatenate_videoclips, AudioFileClip, CompositeAudioClip
|
| 2 |
import streamlit as st
|
| 3 |
import cv2
|
| 4 |
+
import load_dotenv
|
| 5 |
import base64
|
| 6 |
import io
|
| 7 |
import openai
|
|
|
|
| 154 |
}
|
| 155 |
prompt = "Customize your prompt based on the script type selected above and additional features added."
|
| 156 |
|
| 157 |
+
# Generate the initial prompt based on selected script type
|
| 158 |
+
initial_prompt = script_templates[selected_script_type]
|
| 159 |
+
|
| 160 |
+
# Allow the user to edit the prompt
|
| 161 |
+
prompt = st.text_area("Edit the voiceover script prompt as needed:", value=initial_prompt.format(selected_duration=selected_duration), height=300)
|
| 162 |
+
|
| 163 |
+
|
| 164 |
if uploaded_file is not None and st.button("START PROCESSING"):
|
| 165 |
with st.spinner("Processing..."):
|
| 166 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_file, 1)
|