sourize
commited on
Commit
·
655bdb7
1
Parent(s):
69cc47b
Updated Code
Browse files- Dockerfile +10 -2
- utils/prompt_manager.py +17 -2
Dockerfile
CHANGED
|
@@ -39,10 +39,18 @@ RUN apt-get update && apt-get install -y \
|
|
| 39 |
&& rm -rf /var/lib/apt/lists/* \
|
| 40 |
&& apt-get clean
|
| 41 |
|
| 42 |
-
# Create necessary directories
|
| 43 |
RUN mkdir -p /tmp/manimate/output \
|
| 44 |
&& mkdir -p /tmp/matplotlib \
|
| 45 |
-
&&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Copy requirements first to leverage Docker cache
|
| 48 |
COPY requirements.txt .
|
|
|
|
| 39 |
&& rm -rf /var/lib/apt/lists/* \
|
| 40 |
&& apt-get clean
|
| 41 |
|
| 42 |
+
# Create necessary directories and set permissions
|
| 43 |
RUN mkdir -p /tmp/manimate/output \
|
| 44 |
&& mkdir -p /tmp/matplotlib \
|
| 45 |
+
&& mkdir -p /tmp/fontconfig \
|
| 46 |
+
&& chmod 777 /tmp/matplotlib \
|
| 47 |
+
&& chmod 777 /tmp/fontconfig \
|
| 48 |
+
&& fc-cache -f -v
|
| 49 |
+
|
| 50 |
+
# Set fontconfig environment variables
|
| 51 |
+
ENV FONTCONFIG_PATH=/etc/fonts
|
| 52 |
+
ENV FONTCONFIG_FILE=/etc/fonts/fonts.conf
|
| 53 |
+
ENV FONTCONFIG_CACHE=/tmp/fontconfig
|
| 54 |
|
| 55 |
# Copy requirements first to leverage Docker cache
|
| 56 |
COPY requirements.txt .
|
utils/prompt_manager.py
CHANGED
|
@@ -170,6 +170,9 @@ Requirements:
|
|
| 170 |
9. Keep animations under {ANIMATION_CONSTANTS['MAX_DURATION']} seconds total duration
|
| 171 |
10. Use appropriate wait times between animations (between {ANIMATION_CONSTANTS['MIN_WAIT_TIME']} and {ANIMATION_CONSTANTS['MAX_WAIT_TIME']} seconds)
|
| 172 |
11. To set background color, use: self.camera.background_color = WHITE
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
Structure:
|
| 175 |
```python
|
|
@@ -180,8 +183,20 @@ class GeneratedScene(Scene):
|
|
| 180 |
# Set background color
|
| 181 |
self.camera.background_color = WHITE
|
| 182 |
|
| 183 |
-
#
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
```
|
| 186 |
|
| 187 |
Generate ONLY the Python code, no explanations or markdown formatting.
|
|
|
|
| 170 |
9. Keep animations under {ANIMATION_CONSTANTS['MAX_DURATION']} seconds total duration
|
| 171 |
10. Use appropriate wait times between animations (between {ANIMATION_CONSTANTS['MIN_WAIT_TIME']} and {ANIMATION_CONSTANTS['MAX_WAIT_TIME']} seconds)
|
| 172 |
11. To set background color, use: self.camera.background_color = WHITE
|
| 173 |
+
12. For SVG paths, use SVGMobject instead of VMobjectFromSVGPath
|
| 174 |
+
13. Always use proper animation classes (Create, Write, Transform, etc.) with self.play()
|
| 175 |
+
14. For positioning, use methods like next_to(), to_edge(), to_corner() instead of direct position manipulation
|
| 176 |
|
| 177 |
Structure:
|
| 178 |
```python
|
|
|
|
| 183 |
# Set background color
|
| 184 |
self.camera.background_color = WHITE
|
| 185 |
|
| 186 |
+
# Create objects
|
| 187 |
+
obj = Circle(color=BLUE)
|
| 188 |
+
|
| 189 |
+
# Position objects
|
| 190 |
+
obj.to_edge(UP)
|
| 191 |
+
|
| 192 |
+
# Animate objects
|
| 193 |
+
self.play(Create(obj))
|
| 194 |
+
self.wait(1)
|
| 195 |
+
|
| 196 |
+
# Transform objects
|
| 197 |
+
new_obj = Square(color=RED)
|
| 198 |
+
self.play(Transform(obj, new_obj))
|
| 199 |
+
self.wait(1)
|
| 200 |
```
|
| 201 |
|
| 202 |
Generate ONLY the Python code, no explanations or markdown formatting.
|