You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 · reachability default · intent intended-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.
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:
pytest tests/test_inference.py --no-cov
Run these guards/checks as applicable to the changed files:
ruff format --check forgelm/inference.py tests/test_inference.py
ruff check forgelm/inference.py tests/test_inference.py
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 development with Fixes #568 once every finding is resolved or explicitly closed with a reason; use Refs #568 for partial work and list the resolved finding IDs.
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.