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

Model.encode() error #7

Open
mertozlutiras opened this issue Apr 29, 2022 · 1 comment
Open

Model.encode() error #7

mertozlutiras opened this issue Apr 29, 2022 · 1 comment

Comments

@mertozlutiras
Copy link

Problem:

When I run the sample code provided for evaluation, I run for the following error in the file supert.py:

image

Checking the SBERT documentation, I see that model.encode() only returns embeddings, not the tokens itself.

I tried to use the AutoTokenizer from huggingface in order to return tokens, however I ran into assertion error as length of tokens were not equal to length of embeddings.

Before doing more reverse engineering, I wanted to ask you what you wanted to achieve here and if it is a deprecated usage how can we solve it?

Thank you for your help!

@mertozlutiras
Copy link
Author

I couldn't really understand what is meant by all_tokens.

Why does the token tensors' size should be equal to embedding tensors' size?

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