Skip to content

[Wave 3] Medium — Module sweep: Post-training: inference, chat, GGUF export, deploy, merging (part 2/2) #568

Open

Description

@cemililik

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.

Activity

  1. added
    bugSomething isn't working
    severity: mediumReal defect with limited reach or a workaround
    source: review-2026-10Found by the October 2026 code and documentation review
    wave: 3Roadmap wave 3: medium severity, module sweeps
    on Oct 9, 2026
  2. cemililik commented on Oct 11, 2026

    @cemililik
    CollaboratorAuthor

    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:

    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.

  3. added
    help wantedExtra attention is needed
    and removed on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: post-trainingCode area: post-trainingbugSomething isn't workinghelp wantedExtra attention is neededseverity: mediumReal defect with limited reach or a workaroundsource: review-2026-10Found by the October 2026 code and documentation reviewwave: 3Roadmap wave 3: medium severity, module sweeps

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions