Update vision.py
This commit is contained in:
parent
5886ecb246
commit
a98fc9c57c
1 changed files with 3 additions and 2 deletions
|
|
@ -53,9 +53,10 @@ def _wrap_fast_inference(generate, device_type, dtype, model):
|
|||
|
||||
kwargs["pad_token_id"] = kwargs.pop("pad_token_id", model_eos_token_id)
|
||||
|
||||
if "pixel_values" in kwargs:
|
||||
try:
|
||||
kwargs["pixel_values"] = kwargs["pixel_values"].to(model.dtype)
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
# Autocasted
|
||||
with torch.autocast(device_type = device_type, dtype = dtype):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue