Skip to content

Batch generation can silently omit prompts and mishandles max_tokens=0 #1689

Description

@Thump604

Problem

Two generation boundary cases fail unclearly:

  1. A per-prompt list such as max_tokens that is shorter than the prompt list is consumed with unchecked zip, silently omitting trailing prompts.
  2. stream_generate(max_tokens=0) skips the generation loop and later reads locals that were never initialized, raising UnboundLocalError.

Expected behavior

Per-prompt option lengths should be validated before generation, and a zero-token request should terminate normally without entering token generation.

Proposed fix

Draft PR #1681 validates per-prompt list lengths and handles the zero-token path explicitly, with focused regressions for both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions