Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenizer variable is uninitialized when model loaded from clip-ViT-L-14 #1699

Open
Thomas-MMJ opened this issue Sep 17, 2022 · 1 comment
Open

Comments

@Thomas-MMJ
Copy link

from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('clip-ViT-L-14')

my_tok = model.tokenizer

results in

AttributeError: 'SentenceTransformer' object has no attribute 'tokenizer'

@Thomas-MMJ Thomas-MMJ changed the title tokenizer variable is unitialized when model loaded from clip-ViT-L-14 tokenizer variable is uninitialized when model loaded from clip-ViT-L-14 Sep 17, 2022
@Thomas-MMJ
Copy link
Author

looks like we can set model.tokenizer from

model.tokenizer = model._first_module().processor.tokenizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant