RaushanTurganbay HF staff commited on
Commit
c3ec72a
1 Parent(s): 32d2f15

update processor kwargs

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -104,7 +104,7 @@ prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
104
 
105
  image_file = "http://images.cocodataset.org/val2017/000000039769.jpg"
106
  raw_image = Image.open(requests.get(image_file, stream=True).raw)
107
- inputs = processor(prompt, raw_image, return_tensors='pt').to(0, torch.float16)
108
 
109
  output = model.generate(**inputs, max_new_tokens=200, do_sample=False)
110
  print(processor.decode(output[0][2:], skip_special_tokens=True))
@@ -119,7 +119,7 @@ When prompting with videos/3D/multi-view input, prompt like following:
119
  image_tokens = "<image>" * n
120
  prompt = f"<|im_start|>user {image_tokens}\nWhat are these?|im_end|><|im_start|>assistant"
121
 
122
- # With chat template if you sampled 6 frames you have to have 8 images in one conversation turn
123
  conversation = [
124
  {
125
 
 
104
 
105
  image_file = "http://images.cocodataset.org/val2017/000000039769.jpg"
106
  raw_image = Image.open(requests.get(image_file, stream=True).raw)
107
+ inputs = processor(images=raw_image, text=prompt, return_tensors='pt').to(0, torch.float16)
108
 
109
  output = model.generate(**inputs, max_new_tokens=200, do_sample=False)
110
  print(processor.decode(output[0][2:], skip_special_tokens=True))
 
119
  image_tokens = "<image>" * n
120
  prompt = f"<|im_start|>user {image_tokens}\nWhat are these?|im_end|><|im_start|>assistant"
121
 
122
+ # With chat template if you sampled 5 frames you have to have 5 images in one conversation turn
123
  conversation = [
124
  {
125