Skip to content

[BugFix] adjust max_tokens and min_tokens when continue to generate tokens#5010

Merged
LiqinruiG merged 3 commits intoPaddlePaddle:developfrom
kxz2002:bugfix/fix_max_and_min
Nov 13, 2025
Merged

[BugFix] adjust max_tokens and min_tokens when continue to generate tokens#5010
LiqinruiG merged 3 commits intoPaddlePaddle:developfrom
kxz2002:bugfix/fix_max_and_min

Conversation

@kxz2002
Copy link
Contributor

@kxz2002 kxz2002 commented Nov 13, 2025

Motivation

To support model continuous generation, the calculation of max_tokens and min_tokens must be considered.

Modifications

Added logic to compute max_tokens and min_tokens in engine_client.py and ernie4_5_vl_processor.py.

Usage or Command

No change in manual command.

Accuracy Tests

No need.

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link

paddle-bot bot commented Nov 13, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Nov 13, 2025
Copy link
Collaborator

@LiqinruiG LiqinruiG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LiqinruiG LiqinruiG merged commit 9703108 into PaddlePaddle:develop Nov 13, 2025
22 of 24 checks passed
kxz2002 added a commit to kxz2002/FastDeploy that referenced this pull request Nov 14, 2025
…okens (PaddlePaddle#5010)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests
kxz2002 added a commit to kxz2002/FastDeploy that referenced this pull request Nov 14, 2025
…okens (PaddlePaddle#5010)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests
kxz2002 added a commit to kxz2002/FastDeploy that referenced this pull request Nov 14, 2025
…okens (PaddlePaddle#5010)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests
Jiang-Jia-Jun pushed a commit that referenced this pull request Nov 14, 2025
…okens (#5010) (#5013)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests
gzy19990617 added a commit that referenced this pull request Nov 14, 2025
…okens (#5010) (#5015)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests

Co-authored-by: gaoziyuan <88373061+gzy19990617@users.noreply.github.com>
Deleter-D pushed a commit to Deleter-D/FastDeploy that referenced this pull request Nov 26, 2025
…okens (PaddlePaddle#5010) (PaddlePaddle#5015)

* fix max and min tokens initial commit

* fix double subtraction

* add unit tests

Co-authored-by: gaoziyuan <88373061+gzy19990617@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants