-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
[RL][BugFix] Fix missing tokenizer error for token-in-token-out #23904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a bug where using skip_tokenizer_init would cause a crash when making token-in-token-out requests. The changes correctly handle cases where the tokenizer is not initialized by making it optional in several functions. A new test is also added to cover this scenario. My review found a critical issue where a string prompt would still cause a crash if the tokenizer is not initialized. I've provided a code suggestion to add a check and raise a proper error in this case, improving the robustness of the implementation.
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com> Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
DarkLight1337
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Head branch was pushed to by a user without write access
| MODEL_NAME, | ||
| allow_patterns=["*"], | ||
| cache_dir="/tmp/qwen3_06b", | ||
| ignore_patterns=["tokenizer*", "vocab*"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also ignore the safetensors to accelerate test time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignoring safetensors will cause failure, unless we set load format to be dummy.
RuntimeError: Cannot find any model weights with
/tmp/qwen3_06b/models--Qwen--Qwen3-0.6B/snapshots/c1899de289a04d12100db370d81485cdf75e47ca
| from ...utils import RemoteOpenAIServer | ||
|
|
||
| MODEL_NAME = "Qwen/Qwen3-0.6B" | ||
| MODEL_PATH = "/tmp/qwen3_06b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better use a tempdir without hardcoding a path.
youkaichao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix!
|
failures are unrelated, merging. |
…-project#23904) Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
…-project#23904) Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
Purpose
Token-in-token-out is a common use case for RL. Tokenizer is not needed.
Without this PR the API server would complain:
Test Plan
pytest tests/entrypoints/openai/test_token_in_token_out.py
Test Result
Passed
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.