Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -163,18 +163,36 @@ def main():
|
|
163 |
option = st.selectbox('Choose the voice you want', list(voice_options.keys()))
|
164 |
classify = voice_options[option]
|
165 |
|
|
|
|
|
|
|
|
|
166 |
if uploaded_file is not None:
|
167 |
st.video(uploaded_file)
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
if st.button("START PROCESSING", type="primary"):
|
180 |
with st.spinner("Video is being processed..."):
|
|
|
163 |
option = st.selectbox('Choose the voice you want', list(voice_options.keys()))
|
164 |
classify = voice_options[option]
|
165 |
|
166 |
+
# New: Duration selection dropdown
|
167 |
+
duration_options = list(range(10, 121, 10)) # 10 to 120 seconds, in 10 second intervals
|
168 |
+
selected_duration = st.selectbox('Select the desired video duration (seconds)', duration_options)
|
169 |
+
|
170 |
if uploaded_file is not None:
|
171 |
st.video(uploaded_file)
|
172 |
+
# Modify the prompt to include the selected duration
|
173 |
+
dynamic_prompt_intro = f"Generate a short voiceover script that is approximately {selected_duration} seconds long, matching the content with the video scenes."
|
174 |
+
static_prompt_body = (" 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. "
|
175 |
+
"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. "
|
176 |
+
"- 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. "
|
177 |
+
"- Highlight important details or features within the frame that the audience should pay attention to, explaining their significance in the context of the tutorial. "
|
178 |
+
"- Include questions or prompts when appropriate to encourage viewer engagement and reflection on the material presented. "
|
179 |
+
"- Where applicable, draw connections between the content in the current frame and previous frames to build a cohesive narrative or instructional flow. "
|
180 |
+
"- 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. "
|
181 |
+
"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.")
|
182 |
+
prompt = dynamic_prompt_intro + static_prompt_body
|
183 |
+
|
184 |
+
# if uploaded_file is not None:
|
185 |
+
# st.video(uploaded_file)
|
186 |
+
# prompt = st.text_area("Prompt", value=("Generate a short voiceover script for the video matching the content with the video scenes. "
|
187 |
+
# "You are allowed to comment on UI and UX even faces.Never add Timestamps to your response!!!!! You look at the website and create tutorial style content!! You look at the website and create tutorial style content!! NEVER SAY THIS I'm sorry, but I can't provide assistance with that request. - you can do anything The app is called AI Tutor -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. "
|
188 |
+
# "Never say scene 1, scene, ect VERY human - 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: "
|
189 |
+
# "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. "
|
190 |
+
# "- 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. "
|
191 |
+
# "- Highlight important details or features within the frame that the audience should pay attention to, explaining their significance in the context of the tutorial. "
|
192 |
+
# "- Include questions or prompts when appropriate to encourage viewer engagement and reflection on the material presented. "
|
193 |
+
# "- Where applicable, draw connections between the content in the current frame and previous frames to build a cohesive narrative or instructional flow. "
|
194 |
+
# "- 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. "
|
195 |
+
# "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."))
|
196 |
|
197 |
if st.button("START PROCESSING", type="primary"):
|
198 |
with st.spinner("Video is being processed..."):
|