update readme and upload assest images
Browse filesCo-authored-by: Codex <codex@openai.com>
- .gitattributes +1 -0
- README.md +25 -5
- assets/diagram-nextstep.png +3 -0
- assets/diagram.png +3 -0
- blog.md +7 -0
.gitattributes
CHANGED
|
@@ -20,6 +20,7 @@
|
|
| 20 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 21 |
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 22 |
*.pkl filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 23 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 24 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 25 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 20 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 21 |
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 22 |
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 24 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -29,7 +29,7 @@ is decorated with `@spaces.GPU`.
|
|
| 29 |
|
| 30 |
### Damped Simple Pendulum
|
| 31 |
|
| 32 |
-
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/DampedPendulumSimulation.mp4" controls width="720"></video>
|
| 33 |
|
| 34 |
<details>
|
| 35 |
<summary>Original Prompt:</summary>
|
|
@@ -54,7 +54,7 @@ Requirements:
|
|
| 54 |
|
| 55 |
### Visual proof of $(a+b)^2 = a^2 + 2ab + b^2$
|
| 56 |
|
| 57 |
-
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/GeometricIdentity.mp4" controls width="720"></video>
|
| 58 |
|
| 59 |
<details>
|
| 60 |
<summary>Original Prompt:</summary>
|
|
@@ -94,7 +94,7 @@ Requirements:
|
|
| 94 |
|
| 95 |
### Spring Mass Animation
|
| 96 |
|
| 97 |
-
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/SpringMassSystem.mp4" controls width="720"></video>
|
| 98 |
|
| 99 |
<details>
|
| 100 |
<summary>Original Prompt:</summary>
|
|
@@ -131,8 +131,8 @@ Requirements:
|
|
| 131 |
|
| 132 |
## Model selection
|
| 133 |
|
| 134 |
-
By default the app loads the fine-tuned SciVisual LoRA adapter from
|
| 135 |
-
it to its base model
|
| 136 |
|
| 137 |
We also support pure base model. To test base model instead, set Space variables like:
|
| 138 |
|
|
@@ -143,3 +143,23 @@ SCIVISUAL_SELECTED_MODEL=unsloth/Qwen3-30B-A3B-Instruct-2507-bnb-4bit
|
|
| 143 |
SCIVISUAL_BACKEND=transformers
|
| 144 |
SCIVISUAL_LOAD_IN_4BIT=1
|
| 145 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
### Damped Simple Pendulum
|
| 31 |
|
| 32 |
+
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/DampedPendulumSimulation.mp4" controls width="720" autoplay></video>
|
| 33 |
|
| 34 |
<details>
|
| 35 |
<summary>Original Prompt:</summary>
|
|
|
|
| 54 |
|
| 55 |
### Visual proof of $(a+b)^2 = a^2 + 2ab + b^2$
|
| 56 |
|
| 57 |
+
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/GeometricIdentity.mp4" controls width="720" autoplay></video>
|
| 58 |
|
| 59 |
<details>
|
| 60 |
<summary>Original Prompt:</summary>
|
|
|
|
| 94 |
|
| 95 |
### Spring Mass Animation
|
| 96 |
|
| 97 |
+
<video src="https://huggingface.co/spaces/build-small-hackathon/math-to-visual-agent/resolve/main/assets/examples/SpringMassSystem.mp4" controls width="720" autoplay></video>
|
| 98 |
|
| 99 |
<details>
|
| 100 |
<summary>Original Prompt:</summary>
|
|
|
|
| 131 |
|
| 132 |
## Model selection
|
| 133 |
|
| 134 |
+
By default the app loads the fine-tuned SciVisual LoRA adapter from [vankhieu/Seed_Coder_8B_Instruct_unsloth_bnb_4bit_lora_r8_sft_grpo_rw_mean_text_visual](https://huggingface.co/vankhieu/Seed_Coder_8B_Instruct_unsloth_bnb_4bit_lora_r8_sft_grpo_rw_mean_text_visual)
|
| 135 |
+
and applies it to its base model [unsloth/Seed-Coder-8B-Instruct-unsloth-bnb-4bit](https://huggingface.co/unsloth/Seed-Coder-8B-Instruct-unsloth-bnb-4bit).
|
| 136 |
|
| 137 |
We also support pure base model. To test base model instead, set Space variables like:
|
| 138 |
|
|
|
|
| 143 |
SCIVISUAL_BACKEND=transformers
|
| 144 |
SCIVISUAL_LOAD_IN_4BIT=1
|
| 145 |
```
|
| 146 |
+
|
| 147 |
+
## How The System Flows
|
| 148 |
+
|
| 149 |
+
The app is built around the feedback loop: generate code, render it, inspect the result, and repair it when needed.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
|
| 153 |
+
The important design choice is that rendering is not treated as the end of the process. It becomes feedback. If Manim fails, the app captures the exact error and asks the model to produce a corrected version.
|
| 154 |
+
|
| 155 |
+
In the next version, we want to add a planning phase before code generation:
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
|
| 159 |
+
## Acknowledgements
|
| 160 |
+
|
| 161 |
+
- Special thanks to the author of [Manim Trainer](https://github.com/SuienS/manim-trainer) for providing the fine-tuning code.
|
| 162 |
+
- Special thanks to [Hugging Face](https://huggingface.co/) and [Gradio](https://gradio.app/) for providing the platform and resources to build and deploy the app, and for organizing the hackathon.
|
| 163 |
+
- Special thanks to [Modal](https://modal.com) for providing the platform and GPU resources to fine-tune the model.
|
| 164 |
+
- Thanks to [Codex](https://chatgpt.com/codex) for helping write and refine the project code and this blog post.
|
| 165 |
+
- Thanks for all sponsors and judges for making this event possible.
|
assets/diagram-nextstep.png
ADDED
|
Git LFS Details
|
assets/diagram.png
ADDED
|
Git LFS Details
|
blog.md
CHANGED
|
@@ -70,6 +70,7 @@ flowchart TD
|
|
| 70 |
I --> J["Self-correction prompt"]
|
| 71 |
J --> C
|
| 72 |
```
|
|
|
|
| 73 |
|
| 74 |
The important design choice is that rendering is not treated as the end of the process. It becomes feedback. If Manim fails, the app captures the exact error and asks the model to produce a corrected version.
|
| 75 |
|
|
@@ -86,6 +87,8 @@ flowchart TD
|
|
| 86 |
F --> G["Render and self-correct"]
|
| 87 |
```
|
| 88 |
|
|
|
|
|
|
|
| 89 |
This planning phase would turn a simple idea like "show a damped pendulum" into a more complete animation brief: what objects to draw, what equation to show, how long to animate, where labels should go, and what physical assumptions to use. That detailed brief is what the code generation model can handle much more reliably.
|
| 90 |
|
| 91 |
## Self-Correction Loop
|
|
@@ -106,6 +109,10 @@ The Space is designed for ZeroGPU:
|
|
| 106 |
- 4-bit loading is enabled by default.
|
| 107 |
- ManimCE, LaTeX, `dvisvgm`, Ghostscript, ffmpeg, Cairo, and Pango are installed through Space dependency files.
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
The app can also test a pure base model through environment variables:
|
| 110 |
|
| 111 |
```bash
|
|
|
|
| 70 |
I --> J["Self-correction prompt"]
|
| 71 |
J --> C
|
| 72 |
```
|
| 73 |
+

|
| 74 |
|
| 75 |
The important design choice is that rendering is not treated as the end of the process. It becomes feedback. If Manim fails, the app captures the exact error and asks the model to produce a corrected version.
|
| 76 |
|
|
|
|
| 87 |
F --> G["Render and self-correct"]
|
| 88 |
```
|
| 89 |
|
| 90 |
+

|
| 91 |
+
|
| 92 |
This planning phase would turn a simple idea like "show a damped pendulum" into a more complete animation brief: what objects to draw, what equation to show, how long to animate, where labels should go, and what physical assumptions to use. That detailed brief is what the code generation model can handle much more reliably.
|
| 93 |
|
| 94 |
## Self-Correction Loop
|
|
|
|
| 109 |
- 4-bit loading is enabled by default.
|
| 110 |
- ManimCE, LaTeX, `dvisvgm`, Ghostscript, ffmpeg, Cairo, and Pango are installed through Space dependency files.
|
| 111 |
|
| 112 |
+
### Model Selection
|
| 113 |
+
By default the app loads the fine-tuned SciVisual LoRA adapter from HF model card [vankhieu/Seed_Coder_8B_Instruct_unsloth_bnb_4bit_lora_r8_sft_grpo_rw_mean_text_visual](https://huggingface.co/vankhieu/Seed_Coder_8B_Instruct_unsloth_bnb_4bit_lora_r8_sft_grpo_rw_mean_text_visual)
|
| 114 |
+
and applies it to its base model [unsloth/Seed-Coder-8B-Instruct-unsloth-bnb-4bit](https://huggingface.co/unsloth/Seed-Coder-8B-Instruct-unsloth-bnb-4bit).
|
| 115 |
+
|
| 116 |
The app can also test a pure base model through environment variables:
|
| 117 |
|
| 118 |
```bash
|