From b2689ecc64670e0a7da136502f8683368cd87a27 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Tue, 2 Jan 2024 03:41:05 +1100 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 7d0acab52e..3e6aa36099 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -712,6 +712,9 @@ class FastLlamaModel: internal_model = internal_model.model pass internal_model.max_seq_length = max_position_embeddings + + # We check the tokenizer first for errors + check_tokenizer(model, tokenizer) return model, tokenizer pass @@ -756,9 +759,6 @@ class FastLlamaModel: # Clear deleted GPU items gc.collect() torch.cuda.empty_cache() - - # We check the tokenizer first for errors - check_tokenizer(model, tokenizer) return model pass