[GH-ISSUE #279] Question: Do the input tokens have to come from clip.tokenize(str) when using the pretrained model? #242

Open
opened 2026-10-31 21:12:51 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @sunnypurewal on GitHub (Aug 10, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/279

Can I use a different method to tokenize the input prompt and still get a proper prediction or must I use the clip.tokenize(str) method? I'm wondering if I can, for example, use Hugging Face's Bert tokenizer or SentencePiece?

My intuition says that I must use clip.tokenize(str) since that's the set of tokens that the model was trained with.

Originally created by @sunnypurewal on GitHub (Aug 10, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/279 Can I use a different method to tokenize the input prompt and still get a proper prediction or must I use the `clip.tokenize(str)` method? I'm wondering if I can, for example, use Hugging Face's Bert tokenizer or SentencePiece? My intuition says that I _must_ use `clip.tokenize(str)` since that's the set of tokens that the model was trained with.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#242
No description provided.