From d4c06684481be22d58543773d48d01f32e236a49 Mon Sep 17 00:00:00 2001 From: Kareem <81531392+KareemMusleh@users.noreply.github.com> Date: Mon, 17 Mar 2025 05:19:58 +0700 Subject: [PATCH] fix (#2051) --- unsloth/models/llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index b2fbf0d07f..07805271f5 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1548,7 +1548,7 @@ def unsloth_fast_generate( if "input_ids" in kwargs and kwargs["input_ids"] is not None and "max_new_tokens" in kwargs: if kwargs["input_ids"].shape[-1] + kwargs["max_new_tokens"] > self.config.max_position_embeddings: raise ValueError( - f'Unsloth: input length {kwargs["input_ids"].shape[-1]} + max_new_tokens {kwargs["max_new_tokens"]} exceeds the maximum sequence length of {model.config.max_position_embeddings}!\n'\ + f'Unsloth: input length {kwargs["input_ids"].shape[-1]} + max_new_tokens {kwargs["max_new_tokens"]} exceeds the maximum sequence length of {self.config.max_position_embeddings}!\n'\ 'You will need to do long context extension by increasing the `max_seq_length` in `FastLanguageModel.from_pretrained`.' ) pass