Skip to content

Commit

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

* fix: remove tokenizer class check
  • Loading branch information
NanoCode012 authored Oct 5, 2023
1 parent 133e676 commit eb480df
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 eb480df

Please sign in to comment.