zixianma02 commited on
Commit
2dfd311
·
verified ·
1 Parent(s): 60409d1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -1
README.md CHANGED
@@ -123,7 +123,8 @@ inputs = processor.apply_chat_template(
123
  padding=True,
124
  )
125
 
126
- inputs = {k: v.to("cuda") for k, v in inputs.items()}
 
127
 
128
  with torch.inference_mode():
129
  output = model.generate(**inputs, max_new_tokens=200)
 
123
  padding=True,
124
  )
125
 
126
+ # Remove token_type_ids: HF uses it to enable bidirectional attention for image tokens; molmoweb is trained with causal attention only
127
+ inputs = {k: v.to("cuda") for k, v in inputs.items() if k != "token_type_ids"}
128
 
129
  with torch.inference_mode():
130
  output = model.generate(**inputs, max_new_tokens=200)