Spaces:
Running on Zero

Add wayneworkman2012/peacebell-v1-148M (WWII domain model, greedy; additive Peacebell-only branch)

#12

Adds wayneworkman2012/peacebell-v1-148M to the main (chat) arena: https://huggingface.co/wayneworkman2012/peacebell-v1-148M

148.55M parameters, trained from scratch, Apache-2.0. It is a single-domain model: it only knows World War II, and it redirects most other topics back to the war. It will lose plenty of general battles and that is fine; it is a first version and I would like it out there.

Why this is a PR and not just a model id

I replayed this Space's own load_models / build_inputs / generate_for_model code against the model locally. It loads fine with your generic loader (AutoTokenizer + AutoModelForCausalLM, trust_remote_code=True, float32), but every reply came back as [Error generating ... 'GPTForCausalLM' object has no attribute 'generate']. Two reasons, both in my repo's design:

  • the model ships its own KV-cached decoder (chat_generate) instead of HF generate();
  • it has no Jinja chat_template on purpose: the ChatML control tokens are injected by id exactly as at training time (tokenizer.build_chatml_ids), which a string template cannot reproduce with SentencePiece.

So it needs a small special case, the same way MetaDiffusion has one.

What this PR changes (app.py: 20 lines added, 0 removed; requirements.txt: 1 line added)

  • one entry each in MODEL_IDS, MODEL_DISPLAY, MODEL_PARAMS (148.55e6), GEN_DEFAULTS, MODEL_CONTEXT (16384);
  • is_peacebell_model() + generate_peacebell(), and a two-line branch in generate_for_model placed right after the diffusion branch. It honours the same max_new the slider gives every other model;
  • sentencepiece>=0.2.0 in requirements.txt (the model's tokenizer imports it).

Decoding: greedy on purpose. Peacebell is trained and validated at temperature 0, with no repetition penalty and no n-gram block, so that is how it is wired (temperature=0.0, no_repeat_ngram_size=0). Its answers are deterministic.

Nothing else is affected. No existing line is modified; other models never enter the new branch. What I checked locally (transformers 5.14.1, your pinned version):

  • a control entrant, HuggingFaceTB/SmolLM2-135M-Instruct, run through the original and the patched app.py with the same seeds over 8 prompts: output SHA-256 identical (d45c0901...c02f9f both ways);
  • because sentencepiece is a new dependency, I loaded the tokenizer of every model in MODEL_IDS + BASE_MODEL_IDS in a clean environment without and then with sentencepiece installed: tokenizer class, vocabulary size, special tokens, encodings of three test strings and chat-template output are identical for all of them;
  • peak GPU memory for Peacebell in float32: 0.59 GiB. The same modeling code already runs on ZeroGPU in my own demo Space.

Unrelated, in case it helps: DedeProGames/Kiyo-135M currently returns 404 on the Hub (it failed to load in both of my runs), so that entry is probably erroring in battles. I did not touch it.

Sample replies through the patched code, 128 new tokens:

  • "When did World War II begin and end?" -> "World War II began in 1939 and ended in 1945."
  • "Who commanded the Allied forces on D-Day?" -> "General Dwight D. Eisenhower commanded the Allied forces on D-Day."
  • "Tell me a joke." -> "I won't do that. We can go over World War II together, if you'd like to explore it."

Thanks for running the arena.

๐Ÿค– Generated with Claude Code

Thank you for the PR!

CodeSoft changed pull request status to merged

Sign up or log in to comment