Update README.md
Browse files
README.md
CHANGED
@@ -31,13 +31,13 @@ from PIL import Image
|
|
31 |
from transformers import AutoModelForVision2Seq, AutoProcessor, AutoTokenizer, TextStreamer
|
32 |
|
33 |
|
34 |
-
model_id = "/
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
36 |
processor = AutoProcessor.from_pretrained(model_id)
|
37 |
model = AutoModelForVision2Seq.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
|
38 |
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
39 |
|
40 |
-
url = "
|
41 |
image = Image.open(requests.get(url, stream=True).raw)
|
42 |
pixel_values = processor(images=[image], return_tensors="pt").to(model.device)["pixel_values"]
|
43 |
|
|
|
31 |
from transformers import AutoModelForVision2Seq, AutoProcessor, AutoTokenizer, TextStreamer
|
32 |
|
33 |
|
34 |
+
model_id = "hiyouga/PaliGemma-3B-Chat-v0.1"
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
36 |
processor = AutoProcessor.from_pretrained(model_id)
|
37 |
model = AutoModelForVision2Seq.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
|
38 |
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
39 |
|
40 |
+
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
|
41 |
image = Image.open(requests.get(url, stream=True).raw)
|
42 |
pixel_values = processor(images=[image], return_tensors="pt").to(model.device)["pixel_values"]
|
43 |
|