Update app.py
Browse files
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 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 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,
|