DivCenterer

A deliberately tiny, single-task decoder-only Transformer that generates CSS to center one div with either CSS Grid or Flexbox.

Model

  • 1,107,216 parameters; 4 decoder layers, width 144, 4 attention heads, SwiGLU width 384.
  • Trained from scratch with BF16 autocast and PyTorch SDPA on an AMD Radeon RX 9070 XT.
  • Custom 768-token constrained byte-BPE tokenizer; this is not a Transformers AutoModel checkpoint.
  • Files: model.safetensors (weights), config.json, tokenizer.json, model.py, and tokenizer.py.

Load the weights with the included implementation:

import json
import torch
from safetensors.torch import load_file
from model import DivCentererLM, ModelConfig

with open("config.json", encoding="utf-8") as stream:
    config = ModelConfig(**json.load(stream))
model = DivCentererLM(config)
model.load_state_dict(load_file("model.safetensors"))
model.eval()

Data and evaluation

The model was trained on a deterministic synthetic dataset. The prompts and HTML are generated from project-specific templates and word lists; no downloaded corpus or pretrained model weights were used. The model and dataset were developed with AI assistance.

Greedy exact-CSS results on the full synthetic evaluation suite:

Split Exact
Validation 410/410
Held-out pairs 410/410
Unseen values 64/64
Held-out phrasing 96/96
Total 980/980

These scores measure exact matches against the generated dataset's canonical CSS answers.

License

The files in this repository are licensed under the MIT License. See LICENSE.

Downloads last month
-
Safetensors
Model size
1.22M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including thenukegun10x/DivCenterer