Update README.md with recommended way to move tokenized to GPU
Browse files[[Bug] Fix device mismatch in Ministral3 RoPE forward pass #43350](https://github.com/huggingface/transformers/issues/43350)
README.md
CHANGED
|
@@ -502,8 +502,7 @@ messages = [
|
|
| 502 |
|
| 503 |
tokenized = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True)
|
| 504 |
|
| 505 |
-
tokenized
|
| 506 |
-
tokenized["pixel_values"] = tokenized["pixel_values"].to(dtype=torch.bfloat16, device="cuda")
|
| 507 |
image_sizes = [tokenized["pixel_values"].shape[-2:]]
|
| 508 |
|
| 509 |
output = model.generate(
|
|
|
|
| 502 |
|
| 503 |
tokenized = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True)
|
| 504 |
|
| 505 |
+
tokenized = tokenized.to(device="cuda")
|
|
|
|
| 506 |
image_sizes = [tokenized["pixel_values"].shape[-2:]]
|
| 507 |
|
| 508 |
output = model.generate(
|