zandervdm commited on
Commit
bbca86b
·
verified ·
1 Parent(s): c0b0d99

Fix usage snippet: add <|image_pad|> placeholder

Browse files
Files changed (1) hide show
  1. README.md +3 -1
README.md CHANGED
@@ -59,8 +59,10 @@ image = Image.open("photo.jpg").convert("RGB")
59
  statement = "There is a ladder in this image."
60
  answers = ["Yes", "No"]
61
 
 
 
62
  prompt = (
63
- "<|im_start|>user\n<|vision_start|><|vision_end|>"
64
  f"Statement: {statement}\n"
65
  "Is this statement true of the image? Answer Yes or No."
66
  "<|im_end|>\n<|im_start|>assistant\n"
 
59
  statement = "There is a ladder in this image."
60
  answers = ["Yes", "No"]
61
 
62
+ # <|image_pad|> is the placeholder the processor expands into the image tokens.
63
+ # Omit it and you get: "Image features and image tokens do not match".
64
  prompt = (
65
+ "<|im_start|>user\n<|vision_start|><|image_pad|><|vision_end|>"
66
  f"Statement: {statement}\n"
67
  "Is this statement true of the image? Answer Yes or No."
68
  "<|im_end|>\n<|im_start|>assistant\n"