From 82e6fece0b78011707090639823d2d7acf5a3864 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Wed, 10 Jan 2024 01:02:44 +1100 Subject: [PATCH] fix_tokenizer --- unsloth/models/llama.py | 4 ++-- unsloth/models/loader.py | 4 ++-- unsloth/models/mistral.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index f310d102f4..73c78ba0bf 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -619,7 +619,7 @@ class FastLlamaModel: token = None, device_map = "sequential", rope_scaling = None, - check_tokenizer = True, + fix_tokenizer = True, ): SUPPORTS_BFLOAT16 = torch.cuda.is_bf16_supported() gpu_stats = torch.cuda.get_device_properties(0) @@ -704,7 +704,7 @@ class FastLlamaModel: internal_model.max_seq_length = max_position_embeddings # We check the tokenizer first for errors - if check_tokenizer: + if fix_tokenizer: tokenizer = check_tokenizer( model = model, tokenizer = tokenizer, diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index eadf026cc9..48200c3878 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -44,7 +44,7 @@ class FastLanguageModel(FastLlamaModel): token = None, device_map = "sequential", rope_scaling = None, - check_tokenizer = True, + fix_tokenizer = True, *args, **kwargs, ): if not SUPPORTS_FOURBIT and model_name in FOURBIT_MAPPER: @@ -84,7 +84,7 @@ class FastLanguageModel(FastLlamaModel): token = token, device_map = device_map, rope_scaling = rope_scaling, - check_tokenizer = check_tokenizer, + fix_tokenizer = fix_tokenizer, *args, **kwargs, ) pass diff --git a/unsloth/models/mistral.py b/unsloth/models/mistral.py index e15a3ae9ff..e48a982b8c 100644 --- a/unsloth/models/mistral.py +++ b/unsloth/models/mistral.py @@ -263,7 +263,7 @@ class FastMistralModel(FastLlamaModel): token = None, device_map = "sequential", rope_scaling = None, # Mistral does not support RoPE scaling - check_tokenizer = True, + fix_tokenizer = True, ): if rope_scaling is not None: logger.warning_once("Unsloth: Mistral models do not support RoPE scaling.") @@ -333,7 +333,7 @@ class FastMistralModel(FastLlamaModel): internal_model.max_seq_length = max_position_embeddings # We check the tokenizer first for errors - if check_tokenizer: + if fix_tokenizer: tokenizer = check_tokenizer( model = model, tokenizer = tokenizer,