Skip to content

Commit ac5a055

Browse files
authored
Update chameleon.md — fix runtime type error (#33494)
Update chameleon.md Fix error RuntimeError: Input type (float) and bias type (c10::BFloat16) should be the same
1 parent 74026b4 commit ac5a055

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/source/en/model_doc/chameleon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
7878
image = Image.open(requests.get(url, stream=True).raw)
7979
prompt = "What do you see in this image?<image>"
8080

81-
inputs = processor(prompt, image, return_tensors="pt").to(model.device)
81+
inputs = processor(prompt, image, return_tensors="pt").to(model.device, dtype=torch.bfloat16)
8282

8383
# autoregressively complete prompt
8484
output = model.generate(**inputs, max_new_tokens=50)

0 commit comments

Comments
 (0)