-
Notifications
You must be signed in to change notification settings - Fork 231
Tokenize endpoint for LLMs and Visual models #3849
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
base: main
Are you sure you want to change the base?
Conversation
| for (size_t i = 0; i < size; ++i) { | ||
| if (attentionMaskPtr[i] == 0 && !pad_to_max_length) { | ||
| break; | ||
| continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we change that? Do we expect that once we see first 0 in the attention mask any further elements can be different (non-zero)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered the issue that with batched data, attention mask was starting with 0 and then the output was correct
| ASSERT_EQ(tokenArray.Size(), 25); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is no test for add_special_tokens=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is problematic for vison model used here since special tokens are reserved here for images 🤔 I can implement this method only for lm models.
Co-authored-by: Miłosz Żeglarski <milosz.zeglarski@intel.com>
🛠 Summary
CVS-177520
Adding tokenize endpoint same as for embeddings -https://github.com/openvinotoolkit/model_server/blob/main/demos/embeddings/README.md#usage-of-tokenize-endpoint-release-20254-or-weekly
🧪 Checklist
``