Configurable EOS Token Support#20
Merged
edk208 merged 5 commits intoJul 14, 2024
Merged
Conversation
Contributor
|
can you make eos_tokens a list of tokens... to make things easier, maybe they can just be a list of token_ids. also maybe you should always add the tokenizers eos to the list no matter what... |
Contributor
Author
|
The list of token_ids would be represented in config.ini like: Instead of having the strings for eos_tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces the integration of models with different EOS tokens than those used by the default ExllamaV2 tokenizer. This change addresses the need for flexibility in model configurations without the necessity of hardcoding EOS tokens directly into the codebase.
Key Changes
Dynamic EOS Token Configuration: A new optional configuration parameter, eos_token, has been added to the config.ini file. This parameter allows different models to specify their own EOS tokens directly via the configuration file, thus enabling seamless integration of models with unique tokenization requirements.
Default Behavior: If the eos_token key is not present in config.ini, the system will default to using tokenizer.eos_token_id. This ensures backward compatibility and default behavior that aligns with the ExllamaV2 tokenizer's specifications.
Custom EOS Token Support: For models requiring a distinct EOS token, such as Llama3, users can now specify this by adding eos_token = under the appropriate section in the config.ini file. This entry should be followed by the specific EOS token value as needed.
Usage
Users who need to configure a custom EOS token for a model should add or update the eos_token entry in the config.ini file under the relevant model section. For example:
p.s. This should also cover PR #17 , as it was worked from the branch pushed yesterday.