Fix: ValueError when FA + Mistral when padding_side=right (#681)

* Fix: ValueError when FA + Mistral when padding_side=right

* fix: remove tokenizer class check
This commit is contained in:
NanoCode012
2023-10-06 04:12:54 +09:00
committed by GitHub
parent 133e676bcc
commit eb480dfd68

View File

@@ -81,6 +81,9 @@ def load_tokenizer(cfg):
tokenizer.add_special_tokens({"pad_token": "[PAD]"})
os.environ["TOKENIZERS_PARALLELISM"] = "false"
if cfg.is_mistral_derived_model:
tokenizer.padding_side = "left"
if cfg.special_tokens:
for k, val in cfg.special_tokens.items():
tokenizer.add_special_tokens(