Update README.md
#7
by
Cyril666 - opened
README.md
CHANGED
|
@@ -102,7 +102,9 @@ inputs = processor(
|
|
| 102 |
)
|
| 103 |
|
| 104 |
|
| 105 |
-
inputs = {k: v.
|
|
|
|
|
|
|
| 106 |
|
| 107 |
output_ids = model.generate(**inputs, max_new_tokens=128)
|
| 108 |
response = processor.decode(output_ids[0], skip_special_tokens=True)
|
|
|
|
| 102 |
)
|
| 103 |
|
| 104 |
|
| 105 |
+
inputs = {k: v.cuda() if isinstance(v, torch.Tensor) else v for k, v in inputs.items()}
|
| 106 |
+
if "pixel_values" in inputs:
|
| 107 |
+
inputs["pixel_values"] = inputs["pixel_values"].to(torch.bfloat16)
|
| 108 |
|
| 109 |
output_ids = model.generate(**inputs, max_new_tokens=128)
|
| 110 |
response = processor.decode(output_ids[0], skip_special_tokens=True)
|