diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index acf999faff..53a873d168 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -146,6 +146,8 @@ def unsloth_base_fast_generate( try: kwargs["pixel_values"] = kwargs["pixel_values"].to(dtype) except: pass + if "use_cache" not in kwargs: kwargs["use_cache"] = True + # Mixed precision autocast if os.environ.get("UNSLOTH_FORCE_FLOAT32", "0") == "1": autocaster = torch.autocast(device_type = "cuda", dtype = dtype)