Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -130,18 +130,20 @@ def main():
|
|
130 |
option = st.selectbox('Choose the voice you want', ('Female Voice', 'Male Voice'))
|
131 |
classify = 'alloy' if option == 'Male Voice' else 'nova'
|
132 |
|
133 |
-
|
|
|
134 |
st.video(uploaded_file)
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
145 |
if st.button("START PROCESSING", type="primary"):
|
146 |
with st.spinner("Video is being processed..."):
|
147 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_file, frame_sampling_rate=1)
|
|
|
130 |
option = st.selectbox('Choose the voice you want', ('Female Voice', 'Male Voice'))
|
131 |
classify = 'alloy' if option == 'Male Voice' else 'nova'
|
132 |
|
133 |
+
# Assuming the previous code is correctly indented, ensure this block matches
|
134 |
+
if uploaded_file is not None:
|
135 |
st.video(uploaded_file)
|
136 |
+
prompt = st.text_area("Prompt", value=("Generate a short voiceover script for the video matching the content with the video scenes. "
|
137 |
+
"The app is called AI Tutor. The style should be fun and engaging. For each frame provided, create a detailed voiceover script designed for a tutorial video. "
|
138 |
+
"The narration should be informative, engaging, and tailored to an audience seeking to learn from the video content. For each frame, the voiceover script should: "
|
139 |
+
"Never say 'Female 2' or 'VoiceOver' in responses. You output a script to be spoken! - Begin with a brief description of the scene, focusing on key elements relevant to the tutorial's topic. "
|
140 |
+
"- Provide step-by-step instructions or explanations for any actions, processes, or concepts shown in the frame. Use clear and concise language suitable for educational content. "
|
141 |
+
"- Highlight important details or features within the frame that the audience should pay attention to, explaining their significance in the context of the tutorial. "
|
142 |
+
"- Include questions or prompts when appropriate to encourage viewer engagement and reflection on the material presented. "
|
143 |
+
"- Where applicable, draw connections between the content in the current frame and previous frames to build a cohesive narrative or instructional flow. "
|
144 |
+
"- End with a short summary or teaser of what to expect next, maintaining the viewer’s interest and facilitating a smooth transition between sections of the tutorial. "
|
145 |
+
"The goal is to transform the visual information into an accessible and compelling educational narrative that enhances the viewer's understanding and retention of the subject matter."))
|
146 |
+
|
147 |
if st.button("START PROCESSING", type="primary"):
|
148 |
with st.spinner("Video is being processed..."):
|
149 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_file, frame_sampling_rate=1)
|