Skip to content

Conversation

@przepeck
Copy link
Collaborator

@przepeck przepeck commented Dec 8, 2025

🛠 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

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

for (size_t i = 0; i < size; ++i) {
if (attentionMaskPtr[i] == 0 && !pad_to_max_length) {
break;
continue;
Copy link
Collaborator

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)?

Copy link
Collaborator Author

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

@przepeck przepeck requested a review from mzegla December 9, 2025 11:36
ASSERT_EQ(tokenArray.Size(), 25);
}
}

Copy link
Collaborator

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

Copy link
Collaborator Author

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.

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

Successfully merging this pull request may close these issues.

4 participants