blockentropy / ml-client

Machine Learning Clients for Open Source Infra
8 stars 3 forks source link

Configurable EOS Token Support #20

Closed ManilShrestha closed 4 months ago

ManilShrestha commented 4 months ago

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

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:

[llama3-70B]
string = llama3-70B
repo = <path to model>
specrepo = <path to spec model>
max_context = <max context len>
total_context = <total context len>
eos_token = <|eot_id|>

p.s. This should also cover PR #17 , as it was worked from the branch pushed yesterday.

edk208 commented 4 months ago

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...

ManilShrestha commented 4 months ago

The list of token_ids would be represented in config.ini like:

[llama3-70B]
string = llama3-70B
repo = <path to model>
specrepo = <path to spec model>
max_context = <max context len>
total_context = <total context len>
eos_token_ids = 128001,128009

Instead of having the strings for eos_tokens

eos_tokens = <|end_of_text|>,<|eot_id|>