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

[ML] add support for question_answering NLP tasks #457

Merged

Conversation

benwtrent
Copy link
Member

Adds support for question_answering NLP models within the pytorch model uploader.

Related: elastic/elasticsearch#85958

@benwtrent benwtrent added enhancement New feature or request topic:NLP Issue or PR about NLP model support and eland_import_hub_model labels Apr 18, 2022
Comment on lines +133 to +134
if isinstance(response, tuple):
return torch.stack(list(response), dim=0)
Copy link
Member Author

Choose a reason for hiding this comment

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

our internal BERT inference logic takes the first element of the tuple if the returned value is a tuple. This does not work for question answering models as its a tuple of the starts and ends token scores.

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@sethmlarson
Copy link
Contributor

@benwtrent Looks like there's a merge conflict, can you fix this then I'll merge.

@benwtrent
Copy link
Member Author

i got it @sethmlarson don't want to merge until the ES side is all approved and merged. Thanks!

@benwtrent benwtrent merged commit 70fadc9 into elastic:main May 4, 2022
@benwtrent benwtrent deleted the feature/add-question-answering-task branch May 4, 2022 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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