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

Fix failed import of Sentence Transformer RoBERTa models #637

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

davidkyle
Copy link
Member

Uploading the sentence-transformers/all-distilroberta-v1 model to Elasticsearch failed with the following

TypeError: _SentenceTransformerWrapper.forward() missing 2 required positional arguments: 'token_type_ids' and 'position_ids'

The error occurs when the eland_import_hub_model script evaluates the model to measure the size of the output embedding. It can be reproduced with the following command:

eland_import_hub_model --url <elastic> --hub-model-id sentence-transformers/all-distilroberta-v1 --task-type text_embedding

The problem is due to the model's tokenizer type not being recognised due to a simple typo. A test has been added to cover this case.

@davidkyle davidkyle added bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model labels Nov 21, 2023
Copy link
Member

@joshdevins joshdevins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

@davidkyle davidkyle merged commit 081250c into elastic:main Nov 21, 2023
4 checks passed
@davidkyle davidkyle deleted the distillbert-fix branch November 21, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants