Skip to content

Commit

Permalink
Fix: ValueError when FA + Mistral when padding_side=right (axolotl-ai…
Browse files Browse the repository at this point in the history
…-cloud#681)

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

* fix: remove tokenizer class check
  • Loading branch information
NanoCode012 committed Oct 5, 2023
1 parent 1e3fd14 commit a936487
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a936487

Please sign in to comment.