Qwen3.8-27B Fable-Kawaii QLoRA
adapter for 3D scene generation
2 min readupdated
This QLoRA (small lightweight add-on for efficient model training) adapter is trained on Qwen/Qwen3.8-27B using the Fable-Kawaii dataset. The model learns to take a Chinese text scene description, plan its structure, and generate code as a single-file Three.js HTML. The author notes this is a lightweight 30-step test checkpoint for testing the pipeline, which demonstrates functionality but still requires fine-tuning for fully stable generation of complex HTML files. The adapter will be useful for developers and researchers experimenting with generative code and fine-tuning large language models.
Key features
- Base model: Qwen3.8-27B, quantized via 4-bit NF4 with double quantization (requires about 16.7 GB VRAM).
- Training parameters: r=16, alpha=32, dropout=0.05, trained 124.7M parameters (0.45% of the total volume).
- Dataset: Fable-Kawaii Chinese SFT (1026 training and 114 validation examples).
- Stability: A lower learning rate (2e-5) was used instead of 1e-4, which the author reports breaks generation in the base model.
What you can do
- Run inference: Load the adapter on top of the base Qwen model via the
peftlibrary to generate creative code and descriptions. - Test prompts: Try setting up a miniature diorama scenario or scene using a Three.js expert system prompt.
- Continue training: Use the published configuration and dataset for full training of 300–600 steps with 8K+ context.
Example
import torch
from transformers import AutoTokenizer, BitsAndBytesConfig, Qwen3_5ForConditionalGeneration
from peft import PeftModel
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
"Qwen/Qwen3.8-27B", quantization_config=bnb, device_map={"": 0},
dtype=torch.bfloat16)
model = PeftModel.from_pretrained(model, "dya/Qwen3.8-27B-Fable-Kawaii-QLoRA")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.8-27B")
prompt = tok.apply_chat_template(
[{"role": "system", "content": "你是一位擅长 Three.js 微缩场景的创意编程专家。"},
{"role": "user", "content": "做一个雨后的卵石海湾微缩沙盘,带一只滨鹬。"}],
tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(prompt, return_tensors="pt").to(model.device),
max_new_tokens=2048, do_sample=True, temperature=0.8)
print(tok.decode(out[0], skip_special_tokens=True))Read more
Details• Hardware requirements: about 16.7 GB VRAM, training was performed on an A800-80G card.
• Metrics: training loss dropped to an average of 14.86 at lr=2e-5.
• Limitations: 30 steps and 4K context lead to example truncation; the model has learned only the initial structure and general style.
• Dependencies: transformers>=5.8, torch>=2.4 (it is recommended to avoid transformers version 5.24 due to a strict torch>=2.6 requirement).










Comments