From eb480dfd68afced2c9a10632e4ff4c3cab762d78 Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Fri, 6 Oct 2023 04:12:54 +0900 Subject: [PATCH] Fix: ValueError when FA + Mistral when padding_side=right (#681) * Fix: ValueError when FA + Mistral when padding_side=right * fix: remove tokenizer class check --- src/axolotl/utils/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index 7ef22cf5f0..c05bccbf08 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -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(