From ac5a0556f14dec503b064d5802da1092e0b558ea Mon Sep 17 00:00:00 2001 From: Max Buckley Date: Tue, 17 Sep 2024 13:32:49 +0200 Subject: [PATCH] =?UTF-8?q?Update=20chameleon.md=20=E2=80=94=20fix=20runti?= =?UTF-8?q?me=20type=20error=20(#33494)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 323b83813160b0..28ec01ad615871 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)