Demoscener-7B

Demoscener-7B adapts Qwen2.5-Coder-7B Base to short Dwitter JavaScript animations. This repository contains three independently loadable PEFT LoRA adapters:

Adapter Training stage Use it to study
cpt/ Continued pretraining on Dwitter code Dwitter syntax and code completion
curriculum/ CPT followed by training on awesomeness ranked dweets The effect of ranking-based training
grpo/ CPT, curriculum, then human preference optimisation The effect of preference training

Load and switch

from pathlib import Path

from huggingface_hub import snapshot_download
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = Path(snapshot_download("datavorous/Demoscener-7B"))
base_id = "Qwen/Qwen2.5-Coder-7B"  # Base, not Instruct
tokenizer = AutoTokenizer.from_pretrained(base_id)
base = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")

model = PeftModel.from_pretrained(base, str(repo / "cpt"), adapter_name="cpt")
model.load_adapter(str(repo / "curriculum"), adapter_name="curriculum")
model.load_adapter(str(repo / "grpo"), adapter_name="grpo")

inputs = tokenizer("c.width=1920;for(i=0;i<80;i++)x.fillRect(",
                   return_tensors="pt", add_special_tokens=False).to(model.device)
for stage in ("cpt", "curriculum", "grpo"):
    model.set_adapter(stage)
    output = model.generate(**inputs, max_new_tokens=96, do_sample=False,
                            pad_token_id=tokenizer.eos_token_id)
    continuation = output[0][inputs.input_ids.shape[-1]:]
    print(stage, tokenizer.decode(continuation, skip_special_tokens=True))

CPT used Dwitter programs; curriculum continued from CPT using the top 5,000 dweets ranked by awesomeness; GRPO then used human choices among generated continuations. Later stages were trained on quantized bases, so their probabilities on a shared BF16 base may differ from those of the original training runs.

dataset / blog

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for datavorous/Demoscener-7B

Base model

Qwen/Qwen2.5-7B
Adapter
(65)
this model
Adapters
1 model

Dataset used to train datavorous/Demoscener-7B