From 9a7b3324d4569ec07343641f8a55b8b5a2aabc83 Mon Sep 17 00:00:00 2001 From: Max Buckley Date: Sat, 14 Sep 2024 23:42:09 +0200 Subject: [PATCH] Update chameleon.md Fix error RuntimeError: Input type (float) and bias type (c10::BFloat16) should be the same --- docs/source/en/model_doc/chameleon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/en/model_doc/chameleon.md b/docs/source/en/model_doc/chameleon.md index 323b83813160..28ec01ad6158 100644 --- a/docs/source/en/model_doc/chameleon.md +++ b/docs/source/en/model_doc/chameleon.md @@ -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?" -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)