Repository navigation
[Wave 3] Medium — Module sweep: Post-training: inference, chat, GGUF export, deploy, merging (part 2/2) #568
Copy link
Copy link
Open
Labels
area: post-trainingCode area: post-trainingCode area: post-trainingbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededseverity: mediumReal defect with limited reach or a workaroundReal defect with limited reach or a workaroundsource: review-2026-10Found by the October 2026 code and documentation reviewFound by the October 2026 code and documentation reviewwave: 3Roadmap wave 3: medium severity, module sweepsRoadmap wave 3: medium severity, module sweeps
Description
Wave 3 · 1 finding(s) in 1 fix package(s). Fix these whenever a pull request touches this module ("clean the module you touch").
Findings
- CR-A13-033 (code, Medium) — generate/generate_stream override the model's generation_config EOS list with the single tokenizer.eos_token_id, so forgelm chat runs past end-of-turn into fabricated turns
severity Medium · reachabilitydefault· intentintended-but-harmful· confidence confirmed · independently confirmed · reproduced end to end
Failure scenario. An operator fine-tunes, or chats with, a model whose end-of-turn id exists only in generation_config: per the task premise, Gemma-it ([, <end_of_turn>]) and Llama-3-Instruct's original config ([<|end_of_text|>, <|eot_id|>]), with tokenizer eos = document-end. The model correctly emits end-of-turn after its answer, but forgelm chat does not stop. It prints invented 'user ... assistant ...' exchanges with the role markers stripped, until 512 tokens, and stores them in history as the assistan…
Where.forgelm/inference.py:256,forgelm/inference.py:294,forgelm/chat.py:299-300,forgelm/chat.py:279
Recommended fix. Do not pass eos_token_id at all, so that model.generation_config applies. Alternatively, pass the union of generation_config.eos_token_id (normalised to a list) and tokenizer.eos_token_id. Add a test with a tiny model whose generation_config eos list differs from the tokenizer eos, and assert the EosTokenCriteria ids (or that a forced end-of-turn stops generation) for both generate and generate_s…
Done when
- Every finding above is fixed or closed with a reason (tick it here).
- Code fixes carry a test; doc fixes update the Turkish mirror in the same PR.
Found by the October 2026 ForgeLM code and documentation review against commit cab2947. Code links point at that commit; line numbers may have moved since. Finding IDs (CR-…, DOC-…, TECH-…) are stable references for this backlog.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: post-trainingCode area: post-trainingCode area: post-trainingbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededseverity: mediumReal defect with limited reach or a workaroundReal defect with limited reach or a workaroundsource: review-2026-10Found by the October 2026 code and documentation reviewFound by the October 2026 code and documentation reviewwave: 3Roadmap wave 3: medium severity, module sweepsRoadmap wave 3: medium severity, module sweeps
Type
Projects
- StatusShow more project fieldsTodo
Activity
cemililik commentedon Oct 11, 2026
Where to start
Thanks for taking a look. Please confirm the issue is unassigned and comment before starting so work does not overlap.
Start with these files on
development:Stop replacing the model generation_config EOS setting with the tokenizer scalar in synchronous and streaming generation. Let Transformers honor the saved generation configuration; retain a documented fallback only where needed. Add tests with a model EOS list differing from the tokenizer EOS, covering both paths and default behavior; use mocked generation/streaming, no downloads.
Run the focused tests:
Run these guards/checks as applicable to the changed files:
If user-facing documentation changes, update the existing Turkish mirror in the same PR; keep commands, code and terminal output in English and structurally aligned. English-only contributor standards need no new mirror.
Open the PR against
developmentwithFixes #568once every finding is resolved or explicitly closed with a reason; useRefs #568for partial work and list the resolved finding IDs.