Downloads · 30 days
15
25% of all-time downloads
mr-dee/qwen3-p5js-physics-lora
qwen3-p5js-physics-lora is a text generation model from mr-dee. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
LoRA adapter for Qwen/Qwen3-0.6B, tuned for generating educational p5.js animations from natural-language prompts.
Downloads · 30 days
15
25% of all-time downloads
All-time downloads
61
Public
Repo size
173 MB
Likes
1
Public
Click a slice to open those files.
.safetensors162 MB · 93%
From the Hugging Face model README
LoRA adapter for Qwen/Qwen3-0.6B, tuned for generating educational p5.js animations from natural-language prompts.
Primary objective: produce runnable, classroom-friendly JavaScript sketches (setup() + draw()) that explain K-12 science concepts visually.
Qwen/Qwen3-0.6Bmr-dee/qwen3-p5js-physics-loraDirect use:
Downstream use:
Out of scope:
Dataset summary:
Each example contains:
instructiontopicgrade_levelp5js_code (full runnable sketch)Data style constraints emphasized:
setup() and draw() structureHardware and runtime:
accelerateLoRA config:
r=64lora_alpha=128lora_dropout=0.05q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projOptimization config:
2e-40.9090 -> 0.4950 (step 10 to step 90)train_metrics.json): 0.59170.6164These are training-time indicators, not full benchmark performance across external test sets.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE = "Qwen/Qwen3-0.6B"
ADAPTER = "mr-dee/qwen3-p5js-physics-lora"
tokenizer = AutoTokenizer.from_pretrained(BASE, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
BASE,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, ADAPTER)
messages = [
{
"role": "system",
"content": (
"You are a p5.js animation expert for K-12 physics education. "
"Return complete, runnable JavaScript."
),
},
{
"role": "user",
"content": "Create an interactive p5.js sketch that teaches projectile motion.",
},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.4,
top_p=0.9,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
vllm serve Qwen/Qwen3-0.6B \
--enable-lora \
--lora-modules p5js=mr-dee/qwen3-p5js-physics-lora \
--tensor-parallel-size 2 \
--max-model-len 2048
Then query:
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "p5js",
"messages": [
{"role":"system","content":"You are a p5.js animation expert for K-12 physics education."},
{"role":"user","content":"Create an animation showing wave interference with labeled nodes and antinodes."}
],
"max_tokens": 800,
"temperature": 0.4
}'
Important:
prompt_tokens + max_tokens <= max_model_lenIf you use this adapter, cite:
@misc{qwen3_p5js_physics_lora_2026,
title = {qwen3-p5js-physics-lora},
author = {mr-dee},
year = {2026},
url = {https://huggingface.co/mr-dee/qwen3-p5js-physics-lora}
}