Update vision.py

This commit is contained in:
Daniel Han 2025-03-18 21:08:07 -07:00
commit 8831d1d440

View file

@ -89,7 +89,6 @@ def unsloth_base_fast_generate(
raise TypeError("Unsloth: You need to pass in input_ids to .generate!")
assert(type(x) is torch.Tensor)
bsz = x.shape[0]
print(kwargs)
FastBaseModel.for_inference(self)
dtype = _get_dtype(self.config.torch_dtype)
@ -147,8 +146,6 @@ 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)