Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Apr 18, 2024
1 parent e828a1b commit 138ff00
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,14 @@ def convert_clip_checkpoint(checkpoint_path, pytorch_dump_folder_path, config_pa
hf_model.logit_scale = pt_model.logit_scale

# Use a `eos_token` so the example is more meaningful
input_ids = torch.tensor([[config.text_config.bos_token_id] + list(range(3, 77)) + [config.text_config.eos_token_id] + [config.text_config.pad_token_id]])
input_ids = torch.tensor(
[
[config.text_config.bos_token_id]
+ list(range(3, 77))
+ [config.text_config.eos_token_id]
+ [config.text_config.pad_token_id]
]
)
pixel_values = torch.randn(1, 3, 224, 224)

hf_outputs = hf_model(input_ids=input_ids, pixel_values=pixel_values, return_dict=True)
Expand Down

0 comments on commit 138ff00

Please sign in to comment.