Skip to content

Commit

Permalink
Update chameleon.md — fix runtime type error (huggingface#33494)
Browse files Browse the repository at this point in the history
Update chameleon.md

Fix error

RuntimeError: Input type (float) and bias type (c10::BFloat16) should be the same
  • Loading branch information
maxwbuckley committed Sep 17, 2024
1 parent 74026b4 commit ac5a055
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/en/model_doc/chameleon.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
prompt = "What do you see in this image?<image>"

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

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

0 comments on commit ac5a055

Please sign in to comment.