mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
parent
b382a09e28
commit
6cc5411d81
@ -81,7 +81,7 @@ text_prompt = "Generate a coco-style caption.\\n"
|
||||
|
||||
bus_image_url = "https://huggingface.co/datasets/hf-internal-testing/fixtures-captioning/resolve/main/bus.png"
|
||||
bus_image_pil = Image.open(io.BytesIO(requests.get(bus_image_url).content))
|
||||
inputs_to_model = processor(text=text_prompt, images=image_pil)
|
||||
inputs_to_model = processor(text=text_prompt, images=bus_image_pil)
|
||||
|
||||
|
||||
```
|
||||
|
@ -246,7 +246,7 @@ class FuyuForCausalLM(FuyuPreTrainedModel):
|
||||
>>> image = Image.open(requests.get(url, stream=True).raw)
|
||||
>>> prompt = "Generate a coco-style caption.\n"
|
||||
|
||||
>>> inputs = processor(text=text_prompt, images=image, return_tensors="pt")
|
||||
>>> inputs = processor(text=prompt, images=image, return_tensors="pt")
|
||||
>>> outputs = model(**inputs)
|
||||
|
||||
>>> generated_ids = model.generate(**model_inputs, max_new_tokens=7)
|
||||
|
Loading…
Reference in New Issue
Block a user