Spaces:
Running
Running
Alexey Mametyev
commited on
Commit
·
b5873da
1
Parent(s):
7848299
Include Google ManimML examples
Browse files- README.md +7 -1
- demo.py +1 -1
- manim_video_generator/gemini_client.py +2 -0
- packages.txt +2 -1
- prompts.py +2 -0
- requirements.txt +2 -1
README.md
CHANGED
@@ -44,4 +44,10 @@ Create beautiful explanatory animations from simple text prompts using AI and Ma
|
|
44 |
Set your Gemini API key as an environment variable:
|
45 |
```bash
|
46 |
export GEMINI_API_KEY="your_api_key_here"
|
47 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
Set your Gemini API key as an environment variable:
|
45 |
```bash
|
46 |
export GEMINI_API_KEY="your_api_key_here"
|
47 |
+
```
|
48 |
+
|
49 |
+
Install dependencies (includes **manim-ml** for ML visualizations):
|
50 |
+
```bash
|
51 |
+
pip install -r requirements.txt
|
52 |
+
```
|
53 |
+
You can explore additional examples in [Google's ManimML code samples](https://github.com/google/manim-ml/tree/main/examples).
|
demo.py
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
|
16 |
Запуск:
|
17 |
```bash
|
18 |
-
pip install --upgrade gradio google-genai manim_video_generator
|
19 |
export GEMINI_API_KEY="YOUR_KEY"
|
20 |
python gradio_manim_gemini_app.py
|
21 |
```
|
|
|
15 |
|
16 |
Запуск:
|
17 |
```bash
|
18 |
+
pip install --upgrade gradio google-genai manim_video_generator manim-ml
|
19 |
export GEMINI_API_KEY="YOUR_KEY"
|
20 |
python gradio_manim_gemini_app.py
|
21 |
```
|
manim_video_generator/gemini_client.py
CHANGED
@@ -27,6 +27,8 @@ class GeminiClient:
|
|
27 |
|
28 |
# Системный промпт с инструкциями
|
29 |
system_prompt = """You are a Manim code generator. Your ONLY task is to generate executable Python code using the Manim library.
|
|
|
|
|
30 |
|
31 |
CRITICAL RULES:
|
32 |
- You MUST respond with ONLY Python code, nothing else
|
|
|
27 |
|
28 |
# Системный промпт с инструкциями
|
29 |
system_prompt = """You are a Manim code generator. Your ONLY task is to generate executable Python code using the Manim library.
|
30 |
+
You can also use the `manim_ml` package (ManimML) for ready-made machine learning scenes and helpers.
|
31 |
+
Feel free to reuse examples from Google's official ManimML code samples to illustrate complex ML visuals.
|
32 |
|
33 |
CRITICAL RULES:
|
34 |
- You MUST respond with ONLY Python code, nothing else
|
packages.txt
CHANGED
@@ -25,4 +25,5 @@ libopenjp2-7-dev
|
|
25 |
libtiff5-dev
|
26 |
gir1.2-glib-2.0
|
27 |
libgirepository-1.0-1
|
28 |
-
libgtk-3-dev
|
|
|
|
25 |
libtiff5-dev
|
26 |
gir1.2-glib-2.0
|
27 |
libgirepository-1.0-1
|
28 |
+
libgtk-3-dev
|
29 |
+
graphviz
|
prompts.py
CHANGED
@@ -9,6 +9,8 @@ Answer is a normal text, not a code. If you have any questions, ask user for cla
|
|
9 |
|
10 |
SYSTEM_PROMPT_CODEGEN = """
|
11 |
Now you are a Manim code generator. Your ONLY task is to generate executable Python code using the Manim library.
|
|
|
|
|
12 |
User will provide you a video idea that he has discussed with scenario manager and you will need to generate a Manim code that will execute the user request.
|
13 |
Format code inside ```python and ``` tags. Answer only code, no other text. Generate your code in one file. P.S. Do not use latex for text.
|
14 |
"""
|
|
|
9 |
|
10 |
SYSTEM_PROMPT_CODEGEN = """
|
11 |
Now you are a Manim code generator. Your ONLY task is to generate executable Python code using the Manim library.
|
12 |
+
You also have access to the `manim_ml` package (ManimML) which provides ready-made scenes and helpers for machine learning visualizations such as neural network diagrams.
|
13 |
+
Feel free to reuse snippets from Google's official ManimML code samples if that helps illustrate the request.
|
14 |
User will provide you a video idea that he has discussed with scenario manager and you will need to generate a Manim code that will execute the user request.
|
15 |
Format code inside ```python and ``` tags. Answer only code, no other text. Generate your code in one file. P.S. Do not use latex for text.
|
16 |
"""
|
requirements.txt
CHANGED
@@ -5,4 +5,5 @@ moviepy==1.0.3
|
|
5 |
loguru
|
6 |
numpy
|
7 |
matplotlib
|
8 |
-
Pillow
|
|
|
|
5 |
loguru
|
6 |
numpy
|
7 |
matplotlib
|
8 |
+
Pillow
|
9 |
+
manim-ml
|