Spaces:
Runtime error
Runtime error
Commit
·
958e293
1
Parent(s):
2e90707
fix models
Browse files- llm_inference_video.py +21 -8
llm_inference_video.py
CHANGED
|
@@ -113,17 +113,30 @@ Structure: {config['structure']}
|
|
| 113 |
|
| 114 |
Focus on these elements while maintaining the specified sentence count:
|
| 115 |
1. Visual atmosphere and mood
|
| 116 |
-
2.
|
| 117 |
-
3.
|
| 118 |
-
4.
|
| 119 |
-
5.
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
| 122 |
- Short: ONE sentence
|
| 123 |
- Medium: TWO to THREE sentences
|
| 124 |
- Long: FOUR to FIVE sentences
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
# Select provider
|
| 129 |
if provider == "Groq":
|
|
@@ -137,7 +150,7 @@ Keep everything in a single paragraph format. Avoid technical specifications or
|
|
| 137 |
model=model,
|
| 138 |
messages=[
|
| 139 |
{"role": "system", "content": system_message},
|
| 140 |
-
{"role": "user", "content":
|
| 141 |
],
|
| 142 |
temperature=1.2,
|
| 143 |
top_p=0.95,
|
|
|
|
| 113 |
|
| 114 |
Focus on these elements while maintaining the specified sentence count:
|
| 115 |
1. Visual atmosphere and mood
|
| 116 |
+
2. Camera movement and cinematography
|
| 117 |
+
3. Narrative flow
|
| 118 |
+
4. Style and aesthetic choices
|
| 119 |
+
5. Key moments
|
| 120 |
+
6. Emotional impact
|
| 121 |
+
|
| 122 |
+
IMPORTANT REQUIREMENTS:
|
| 123 |
+
- Deliver exactly the specified number of sentences
|
| 124 |
- Short: ONE sentence
|
| 125 |
- Medium: TWO to THREE sentences
|
| 126 |
- Long: FOUR to FIVE sentences
|
| 127 |
+
- If camera movements are specified, you MUST incorporate them into the description
|
| 128 |
+
- Keep everything in a single paragraph format
|
| 129 |
+
- Avoid technical specifications or shot lists
|
| 130 |
+
- Avoid starting with 'The video opens with...' or 'The video starts with...'"""
|
| 131 |
+
|
| 132 |
+
# Format the user prompt with style guidance and camera movement
|
| 133 |
+
user_prompt = f"""Style Guide: {selected_style.capitalize()} Style
|
| 134 |
+
{prompt_templates[selected_style]}
|
| 135 |
+
|
| 136 |
+
Camera Movement: {camera_movement if camera_movement else 'No specific camera movement'}
|
| 137 |
+
Core Concept: {input_concept}
|
| 138 |
|
| 139 |
+
Please create a {prompt_length.lower()}-length description incorporating these elements into a cohesive narrative."""
|
| 140 |
|
| 141 |
# Select provider
|
| 142 |
if provider == "Groq":
|
|
|
|
| 150 |
model=model,
|
| 151 |
messages=[
|
| 152 |
{"role": "system", "content": system_message},
|
| 153 |
+
{"role": "user", "content": user_prompt}
|
| 154 |
],
|
| 155 |
temperature=1.2,
|
| 156 |
top_p=0.95,
|