21 3 days ago

Fine-tuned Qwen2.5-Coder-14B-Instruct-128K model trained on dalle2/3blue1brown-manim dataset with 2,407 high-quality examples from HuggingFace.

Models

View all →

Readme

Qwen2.5-Coder-Manim: Mathematical Animation Code Generator

Fine-tuned Qwen2.5-Coder-14B-Instruct model specialized for generating clean, executable Manim code for mathematical visualizations and educational animations. Trained on dalle2/3blue1brown-manim dataset with 2,407 high-quality examples.

🚀 Quick Start

ollama run Maternion/qwen2.5-coder-manim:Q4_K_M or ollama run Maternion/qwen2.5-coder-manim:Q6_K

💡 Example Usage

Input: “Create a circle that transforms into a square”

Output:

from manim import *
class CircleToSquare(Scene):
    def construct(self):
        circle = Circle(radius=2, color=BLUE)
        square = Square(side_length=4, color=RED)
        self.play(Create(circle))
        self.wait(1)
        self.play(Transform(circle, square), run_time=2)
        self.wait(2)

🔧 Model Details

  • Base Model: Qwen/Qwen2.5-Coder-14B-Instruct (14.7B parameters)
  • Training Dataset: dalle2/3blue1brown-manim (2,407 examples)
  • Context Length: 131,072 tokens
  • Format: GGUF F16 (~15GB)
  • Fine-tuning: QLoRA with LoRA rank 8

⚙️ Recommended Settings

  • Temperature: 0.3 (balance accuracy with creativity)
  • Top-p: 0.8
  • Top-k: 40
  • Repeat penalty: 1.1

📝 Modelfile

FROM ./qwen-manim-complete-2-f16.gguf
PARAMETER temperature 0.3
PARAMETER top_p 0.8
PARAMETER top_k 40
PARAMETER repeat_penalty 1.1
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
TEMPLATE """<|im_start|>system
You are an expert in Manim version 0.19.0. Generate clean, executable code for mathematical animations based on user requests.<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""

🎓 Applications

  • Mathematical concept visualization
  • Educational animations (3Blue1Brown style)
  • Physics simulations and demonstrations
  • Algorithm visualization
  • Data science animations
  • Lecture content creation

⚠️ Limitations

  • Optimized for Manim v0.19.0 syntax
  • Best suited for mathematical/educational content
  • English prompts work best
  • May need adjustments for newer Manim versions

Built for mathematical education and beautiful animation generation!