Fix: ValueError when FA + Mistral when padding_side=right (#681)
Browse files* Fix: ValueError when FA + Mistral when padding_side=right
* fix: remove tokenizer class check
src/axolotl/utils/models.py
CHANGED
@@ -81,6 +81,9 @@ def load_tokenizer(cfg):
|
|
81 |
tokenizer.add_special_tokens({"pad_token": "[PAD]"})
|
82 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
83 |
|
|
|
|
|
|
|
84 |
if cfg.special_tokens:
|
85 |
for k, val in cfg.special_tokens.items():
|
86 |
tokenizer.add_special_tokens(
|
|
|
81 |
tokenizer.add_special_tokens({"pad_token": "[PAD]"})
|
82 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
83 |
|
84 |
+
if cfg.is_mistral_derived_model:
|
85 |
+
tokenizer.padding_side = "left"
|
86 |
+
|
87 |
if cfg.special_tokens:
|
88 |
for k, val in cfg.special_tokens.items():
|
89 |
tokenizer.add_special_tokens(
|