Skip to content
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

[FIX] Update EOS from config #2475

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zhengy001
Copy link
Contributor

@zhengy001 zhengy001 commented Dec 13, 2024

Motivation

Correct EOS as default tokenizer eos_token_id may different from model config eos_token_id

Modifications

Checklist

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

@zhengy001
Copy link
Contributor Author

Per @remixer-dec, model Mistral-Nemo-Instruct-2407-Q5_K_L.gguf has this issue.

@@ -247,6 +247,10 @@ async def _tokenize_one_request(
# Parse sampling parameters
sampling_params = SamplingParams(**obj.sampling_params)
sampling_params.normalize(self.tokenizer)
sampling_params.update_from_config(
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert the changes in tokenizer_manager.py and sampling_params.py. Move all related changes to schedule_batch.py.
Reason:
The sampling_params is used to handle per-request configs, but this eos_token_ids form hf_config is the same for all requests, so we do not need to attach it to sampling_params.
To reduce the overhead, we should pre-process the hf-config and add some more conditions in check_finished

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add an input argument for check_finished as Req cannot acquire model info.

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

Successfully merging this pull request may close these issues.

2 participants