yukee1992 commited on
Commit
1105426
·
verified ·
1 Parent(s): 80aadbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -19
app.py CHANGED
@@ -114,26 +114,58 @@ def generate_script(topic: str) -> str:
114
 
115
  clean_topic = topic.strip().strip("['").strip("']").strip('"').strip("'")
116
  logger.info(f"🎯 Generating script for: '{clean_topic}'")
117
-
118
  prompt = (
119
- f"Create a detailed 60-second YouTube/TikTok video script about: {clean_topic}\n\n"
120
- "REQUIREMENTS:\n"
121
- "- Total duration: 60 seconds exactly\n"
122
- "- Engaging hook in first 5 seconds\n"
123
- "- Clear structure with timestamps every 10-15 seconds\n"
124
- "- Conversational, engaging tone for social media\n"
125
- "- End with strong call-to-action\n"
126
- "- Include both voiceover and visual descriptions\n"
127
- "- Minimum 800 characters for proper 60-second video\n\n"
128
- "SCRIPT FORMAT:\n"
129
- "[0:00-0:05] HOOK: Grab attention immediately\n"
130
- "[0:05-0:15] INTRODUCTION: Introduce topic and yourself\n"
131
- "[0:15-0:45] MAIN CONTENT: 2-3 key points with examples\n"
132
- "[0:45-0:55] BENEFIT: Why this matters to viewers\n"
133
- "[0:55-1:00] CTA: Clear call to action (follow, comment, like)\n\n"
134
- "Include both VOICEOVER and VISUAL descriptions.\n\n"
135
- "SCRIPT:"
136
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  inputs = generator.tokenizer(
139
  prompt,
 
114
 
115
  clean_topic = topic.strip().strip("['").strip("']").strip('"').strip("'")
116
  logger.info(f"🎯 Generating script for: '{clean_topic}'")
 
117
  prompt = (
118
+ f"Create a detailed 60-second YouTube/TikTok video script about: {clean_topic}\n\n"
119
+ "CRITICAL REQUIREMENTS:\n"
120
+ "- Total duration: 60 seconds exactly with clear timestamps\n"
121
+ "- Each scene must have BOTH visual description AND voiceover text\n"
122
+ "- Visual descriptions should be specific, searchable keywords for stock videos\n"
123
+ "- Voiceover should be conversational and engaging\n"
124
+ "- NO personal introductions - focus on content only\n\n"
125
+
126
+ "SCRIPT STRUCTURE:\n"
127
+ "[0:00-0:08] VISUAL: [Attention-grabbing visual - dramatic/curious imagery]\n"
128
+ "VOICEOVER: [8-second hook that creates curiosity and grabs attention]\n\n"
129
+
130
+ "[0:08-0:45] VISUAL: [Action-oriented visuals demonstrating the topic]\n"
131
+ "VOICEOVER: [37-second valuable content with key insights, facts, and practical tips]\n\n"
132
+
133
+ "[0:45-0:55] VISUAL: [Transformation/result visual showing benefits]\n"
134
+ "VOICEOVER: [10-second summary of key benefits and value]\n\n"
135
+
136
+ "[0:55-1:00] VISUAL: [Call-to-action visual with text overlay]\n"
137
+ "VOICEOVER: [5-second clear call to action]\n\n"
138
+
139
+ "VISUAL DESCRIPTION GUIDELINES:\n"
140
+ "- Be specific and descriptive (e.g., 'time-lapse of healthy meal preparation' not just 'cooking')\n"
141
+ "- Include 3-5 searchable keywords for stock footage\n"
142
+ "- Focus on actions, transformations, and results\n"
143
+ "- Think about what would look good as stock footage\n"
144
+ "- Avoid generic terms, be visual and concrete\n\n"
145
+
146
+ "VOICEOVER GUIDELINES:\n"
147
+ "- No personal introductions ('I'm...', 'My name is...')\n"
148
+ "- Focus on viewer benefits and valuable information\n"
149
+ "- Include surprising facts, statistics, or insights\n"
150
+ "- Use conversational, engaging tone\n"
151
+ "- End with strong, clear call-to-action\n\n"
152
+
153
+ "EXAMPLE FORMAT:\n"
154
+ "[0:00-0:08] VISUAL: dramatic time-lapse of vibrant superfoods being prepared\n"
155
+ "VOICEOVER: This one simple change can boost your energy by 200% in just 30 days\n\n"
156
+
157
+ "[0:08-0:45] VISUAL: quick cuts of people experiencing energy and vitality\n"
158
+ "VOICEOVER: Studies show that incorporating these 3 foods into your diet can transform your health, improve digestion, and increase mental clarity starting today\n\n"
159
+
160
+ "[0:45-0:55] VISUAL: side-by-side comparison showing transformation\n"
161
+ "VOICEOVER: Imagine waking up with more energy, better focus, and feeling amazing every single day\n\n"
162
+
163
+ "[0:55-1:00] VISUAL: text overlay with social media handles and subscribe button\n"
164
+ "VOICEOVER: Follow for daily tips and transform your health starting now!\n\n"
165
+
166
+ "NOW CREATE SCRIPT FOR: {clean_topic}\n\n"
167
+ "SCRIPT:"
168
+ )
169
 
170
  inputs = generator.tokenizer(
171
  prompt,