Add wayneworkman2012/peacebell-v1-148M to the Instruct models (additive, Peacebell-only path)

#11

Hi, I'd like to add peacebell-v1-148M to the Instruct models: https://huggingface.co/wayneworkman2012/peacebell-v1-148M

148.55M parameters, trained from scratch, Apache-2.0, ChatML chat model. It is a single-domain model: it only knows World War II and redirects most other topics back to the war. It is a first version and I would like it out there next to the others.

I know you normally take requests as a discussion and add the row yourself. I opened a PR because a row alone would not work for this model, and I wanted to hand you something already tested. Feel free to apply it your own way instead of merging.

Why a row alone is not enough

I ran this Space's own code (everything above the UI section of app.py) against the model locally, on CPU. It loads fine through _load_tokenizer / _load_model, but every reply came back as [Generation Error] 'GPTForCausalLM' object has no attribute 'generate'. Two reasons, both by design in my repo:

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

What this PR changes (app.py: 29 lines added, 0 removed or edited; README.md: 1 line added)

  • one row in INSTRUCT_MODEL_ROWS and one line in the README models: list;
  • _is_peacebell_spec() and _stream_peacebell_text(), plus a three-line branch in _stream_single_text after the shared model load and stop-signal reset. It yields the same cumulative partial text as _stream_text_from_model, honours Max tokens and the Stop button, and reports failures in the same [Generation Error] ... form, so a problem with this model cannot take down a run.

No new dependency: sentencepiece is already in requirements.txt.

Decoding: greedy on purpose. Peacebell is trained and validated at temperature 0 with no repetition penalty, so this path always decodes that way. The temperature, top-p and repetition-penalty sliders do not apply to it; its answers are deterministic.

Nothing else is affected. No existing line is modified and other models never enter the new branch. Checked on CPU with 2 threads, under both transformers 5.14.1 / torch 2.8 and your pinned setup (transformers main 5.18.0.dev0, torch 2.14):

  • control entrants run through the original and the patched app.py with identical seeds give byte-identical output: HuggingFaceTB/SmolLM2-135M-Instruct (chat-template path) and HuggingFaceTB/SmolLM2-135M (raw-prompt path);
  • a mixed three-model run through _stream_arena_outputs with Peacebell in the middle works, including the two-model cache eviction;
  • Stop ends the Peacebell stream on the next token;
  • Peacebell itself: loads in under 2 s, about 0.6 GB in float32, a 113-token answer streams in about 2 s on 2 CPU threads.

Sample replies through the patched code:

  • "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.

StentorLabs changed pull request status to merged

Thanks for the detailed write-up and for putting together the PR! I’ve merged it, and peacebell-v1-148M is now added to the SLM Arena Instruct models.

Really appreciate you testing it against the arena code and handling the custom generation path cleanly.

Sign up or log in to comment