Skip to content

Conversation

@avikeid2007
Copy link
Contributor

Fix: InteractiveExecutor not generating tokens

Description

This PR fixes a bug where InteractiveExecutor loads the model successfully but does not generate any response tokens when using ChatSession.ChatAsync() or Executor.InferAsync().

Issue

The PostProcess method was returning true for breakGeneration in the default fallthrough case, causing the inference loop to exit immediately before any tokens could be sampled.

Changes

  • Changed the default return value in PostProcess from true to false
// Before
return Task.FromResult((true, (IReadOnlyList<string>)[]));

// After
return Task.FromResult((false, (IReadOnlyList<string>)[]));

The PostProcess method in InteractiveExecutor was always returning true
for breakGeneration, causing the inference loop to exit immediately after
the first iteration before any tokens could be generated.

Changed the final return statement to return false, allowing generation
to continue until a proper stop condition is met (anti-prompt, EOS token,
or max tokens reached).
@SignalRT
Copy link
Collaborator

Thanks for chasing down this issue. I think the same change is in PR #1261 . I’d prefer to merge the mtmd PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants