Update _utils.py
This commit is contained in:
parent
aed494a1ca
commit
4a695a73f5
1 changed files with 1 additions and 1 deletions
|
|
@ -148,7 +148,7 @@ def patch_tokenizer(model, tokenizer):
|
|||
model.config.update({"unsloth_version" : __version__})
|
||||
if not hasattr(tokenizer, "pad_token") or tokenizer.pad_token is None:
|
||||
# Fixes https://github.com/unslothai/unsloth/issues/5
|
||||
if hasattr(tokenizer, "unk_token"):
|
||||
if hasattr(tokenizer, "unk_token") and tokenizer.unk_token is not None:
|
||||
tokenizer.add_special_tokens({"pad_token" : tokenizer.unk_token})
|
||||
tokenizer.pad_token = tokenizer.unk_token
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue