TeachMaster Coder
TSX educational animation generator
2 min readupdated
A new LoRA based on Qwen/Qwen3.8-27B turns text lectures, lesson outlines, and JSON image descriptions into ready-to-run React and Remotion (TSX) code for creating animated educational videos. Trained strictly on Chinese educational materials, the adapter structures content into headings, diagrams, formulas, and visual blocks on a 1920x1080 canvas. It is useful for developers and educational content creators looking to automate slide layout and animation.
Key features
- Base model: trained on top of Qwen/Qwen3.8-27B using the Qwen3_5ForConditionalGeneration architecture.
- TSX generation: converts lecture markup into Remotion components with frame-by-frame animation.
- Asset handling: integrates images from specified paths via
staticFileand JSON planning. - Training parameters: LoRA rank 64, alpha 128 targeting
q_proj,k_proj,v_proj, ando_proj.
What you can do
- Assemble videos: plug the model into a pipeline to automatically convert text notes into video slides.
- Visualize formulas: generate code for math blocks, diagrams, and learning timelines.
- Integrate with Remotion: drop the generated TSX code into Remotion projects to render educational videos.
Example
import torch
from peft import PeftModel
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
base_id = "Qwen/Qwen3.8-27B"
adapter_id = "posprivacy/teachmaster-qwen38-27b-lora"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base = Qwen3_5ForConditionalGeneration.from_pretrained(
base_id,
dtype=torch.bfloat16,
device_map="auto",
attn_implementation="sdpa",
)
model = PeftModel.from_pretrained(base, adapter_id).eval()Read more
DetailsBenchmarks: final training loss reached 0.1855, with validation loss at 0.1733.
Hardware requirements: trained on 8 × NVIDIA A800 80GB GPUs in BF16.
Limitations: the model does not always stick to the target video duration (generating 16–21 seconds instead of 40) and may leave excessive empty space in the center of the frame.










Comments