From adf8fb9b80fcd0226c539e6b6b62a2bbc8c7dce8 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 26 Mar 2025 03:13:48 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 6e1c996304..a566f023b5 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -145,8 +145,11 @@ def unsloth_base_fast_generate( kwargs[key] = 1 global PROMPT_LOOPKUP if arch not in PROMPT_LOOPKUP: - PROMPT_LOOPKUP[arch] = True - + # Only works for VLMs and not LLMs! + if is_vlm: + PROMPT_LOOPKUP[arch] = False + else: + PROMPT_LOOPKUP[arch] = True if bsz == 1 and PROMPT_LOOPKUP[arch]: kwargs["prompt_lookup_num_tokens"] = 3 @@ -201,8 +204,6 @@ def unsloth_base_fast_generate( kwargs["cache_implementation"] = cache_implementation kwargs["compile_config"] = _compile_config pass - import pprint - pprint.pprint(args, kwargs) try: with torch.inference_mode(), autocaster: