Update chat_templates.py
This commit is contained in:
parent
9b3dd3e9f8
commit
58d1f1e03c
1 changed files with 6 additions and 2 deletions
|
|
@ -298,8 +298,12 @@ def get_chat_template(
|
|||
pass
|
||||
pass
|
||||
|
||||
logger.warning_once(f"Unsloth: Will map {stop_word} to EOS = {tokenizer.eos_token}.")
|
||||
string_vocab = string_vocab.replace(tokenizer.eos_token, stop_word)
|
||||
if not stop_word in token_mapping.values():
|
||||
# Do not map 107 = <|im_end|> and 1 = <|im_end|>. This will reduce the vocab size by 1
|
||||
logger.warning_once(f"Unsloth: Will map {stop_word} to EOS = {tokenizer.eos_token}.")
|
||||
string_vocab = string_vocab.replace(tokenizer.eos_token, stop_word)
|
||||
pass
|
||||
|
||||
new_tokenizer = tokenizer._tokenizer.from_str(string_vocab)
|
||||
tokenizer = tokenizer.__class__(tokenizer_object = new_tokenizer, eos_token = stop_word)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue