hiyouga commited on
Commit
4d97e30
1 Parent(s): a3e666b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -31,13 +31,13 @@ from PIL import Image
31
  from transformers import AutoModelForVision2Seq, AutoProcessor, AutoTokenizer, TextStreamer
32
 
33
 
34
- model_id = "/raid/zhangrichong/data/zhengyw/llama_factory/models/paligemma-chat"
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 = "hiyouga/PaliGemma-3B-Chat-v0.1"
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