tsi-org commited on
Commit
32cec0b
1 Parent(s): 76d8edf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -178,16 +178,28 @@ def main():
178
 
179
  voice_options = {'Echo (Male)': 'echo', 'Fable (Male)': 'fable', 'Onyx (Male)': 'onyx', 'Nova (Female)': 'nova', 'Shimmer (Female)': 'shimmer', 'Alloy (Female)': 'alloy'}
180
  voice = st.selectbox('Choose the voice you want', list(voice_options.keys()))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
- duration_options = list(range(10, 121, 10)) # 10 to 120 seconds, in 10-second intervals
183
- selected_duration = st.selectbox('Select the desired video duration (seconds)', duration_options)
184
 
185
  script_type_options = {'Product Tutorial': 'Product Tutorial', 'TikTok': 'TikTok', 'YouTube Short': 'YouTube Short', 'Website Tutorial': 'Website Tutorial', 'General Info': 'General Info'}
186
  selected_script_type = st.selectbox('Choose the script generator type', list(script_type_options.keys()))
187
 
188
  # Define unique prompt templates for each script type, including the dynamic content for "Product Tutorial"
189
  script_templates = {
190
- 'Product Tutorial': f"Generate a short voiceover that is approximately {selected_duration} seconds long.Your script should be limited to {selected_duration} seconds only! DO NOT exceed {selected_duration} seconds. Lets roleplay you are a script generator for tutorials. Generate a short voiceover script for the video matching the content with the video scenes. Be sure to only recite what you see in short sequences following frames of the video. You are allowed to comment on UI and UX even faces. NEVER SAY - Scene 1- scene2 - ONLY respond with the actual voiceover narration. Never add Timestamps to your response! You look at the website and create tutorial style content!! The app is called Pixio. The style should be fun and engaging. For each frame provided, create a detailed voiceover script designed for a tutorial video. Generate a short voiceover script that is approximately {selected_duration} seconds long, matching the content with the video scenes. " +
191
  "The app is called Pixio. The style should be fun and engaging. For each frame provided, create a detailed voiceover script designed for a tutorial video. " +
192
  "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. " +
193
  "- 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. " +
 
178
 
179
  voice_options = {'Echo (Male)': 'echo', 'Fable (Male)': 'fable', 'Onyx (Male)': 'onyx', 'Nova (Female)': 'nova', 'Shimmer (Female)': 'shimmer', 'Alloy (Female)': 'alloy'}
180
  voice = st.selectbox('Choose the voice you want', list(voice_options.keys()))
181
+ # Assuming 1 minute (60 seconds) is 65 words
182
+ words_per_second = 65 / 60
183
+
184
+ # User selects duration in seconds
185
+ duration_options = list(range(10, 121, 10)) # 10 to 120 seconds, in 10-second intervals
186
+ selected_duration_seconds = st.selectbox('Select the desired video duration (seconds)', duration_options)
187
+
188
+ # Calculate the target word count based on the selected duration in seconds
189
+ target_word_count = int(selected_duration_seconds * words_per_second)
190
+
191
+
192
+
193
+ # duration_options = list(range(10, 121, 10)) # 10 to 120 seconds, in 10-second intervals
194
+ # selected_duration = st.selectbox('Select the desired video duration (seconds)', duration_options)
195
 
 
 
196
 
197
  script_type_options = {'Product Tutorial': 'Product Tutorial', 'TikTok': 'TikTok', 'YouTube Short': 'YouTube Short', 'Website Tutorial': 'Website Tutorial', 'General Info': 'General Info'}
198
  selected_script_type = st.selectbox('Choose the script generator type', list(script_type_options.keys()))
199
 
200
  # Define unique prompt templates for each script type, including the dynamic content for "Product Tutorial"
201
  script_templates = {
202
+ 'Product Tutorial': f"Generate a short voiceover that is approximately {target_word_count} words and {selected_duration} seconds long.Your script should be limited to {selected_duration} seconds only! DO NOT exceed {selected_duration} seconds. Lets roleplay you are a script generator for tutorials. Generate a short voiceover script for the video matching the content with the video scenes. Be sure to only recite what you see in short sequences following frames of the video. You are allowed to comment on UI and UX even faces. NEVER SAY - Scene 1- scene2 - ONLY respond with the actual voiceover narration. Never add Timestamps to your response! You look at the website and create tutorial style content!! The app is called Pixio. The style should be fun and engaging. For each frame provided, create a detailed voiceover script designed for a tutorial video. Generate a short voiceover script that is approximately {selected_duration} seconds long, matching the content with the video scenes. " +
203
  "The app is called Pixio. The style should be fun and engaging. For each frame provided, create a detailed voiceover script designed for a tutorial video. " +
204
  "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. " +
205
  "- 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. " +