Update README.md
#41
by
ybelkada
- opened
README.md
CHANGED
|
@@ -96,9 +96,7 @@ text_prompt = "What is the highest life expectancy at birth of male?\n"
|
|
| 96 |
image_path = "chart.png" # https://huggingface.co/adept-hf-collab/fuyu-8b/blob/main/chart.png
|
| 97 |
image_pil = Image.open(image_path)
|
| 98 |
|
| 99 |
-
model_inputs = processor(text=text_prompt, images=[image_pil]
|
| 100 |
-
for k, v in model_inputs.items():
|
| 101 |
-
model_inputs[k] = v.to("cuda:0")
|
| 102 |
|
| 103 |
generation_output = model.generate(**model_inputs, max_new_tokens=16)
|
| 104 |
generation_text = processor.batch_decode(generation_output[:, -16:], skip_special_tokens=True)
|
|
|
|
| 96 |
image_path = "chart.png" # https://huggingface.co/adept-hf-collab/fuyu-8b/blob/main/chart.png
|
| 97 |
image_pil = Image.open(image_path)
|
| 98 |
|
| 99 |
+
model_inputs = processor(text=text_prompt, images=[image_pil]).to("cuda:0")
|
|
|
|
|
|
|
| 100 |
|
| 101 |
generation_output = model.generate(**model_inputs, max_new_tokens=16)
|
| 102 |
generation_text = processor.batch_decode(generation_output[:, -16:], skip_special_tokens=True)
|