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

Embeddings fix for truncation without room for begin/end and for batch truncation #343

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

markstur
Copy link
Contributor

@markstur markstur commented Apr 3, 2024

  • Attempting truncate_input_tokens=2 (or 1) was creating a strange error (or misbehaving) because it takes at least 3 tokens for [CLS] TOK [SEP] for meaningful results.
  • Now that truncate value generally means number of tokens not including begin/end.
  • On the max end the 2 special tokens will be allowed to consume 2 from the limit.
  • Batch embedding processing was returning odd/misordered results when combined with truncation. Added a re tokenize() call to avoid sending the overflow tokens as features to be processed.

…h truncation

* Attempting truncate_input_tokens=2 (or 1) was creating a strange error (or misbehaving)
  because it takes at least 3 tokens for [CLS] TOK [SEP] for meaningful results.
* Now that truncate value generally means number of tokens not including begin/end.
* On the max end the 2 special tokens will be allowed to consume 2 from the limit.
* Batch embedding processing was returning odd/misordered results when combined with
  truncation. Added a re tokenize() call to avoid sending the overflow tokens as features
  to be processed.

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
Copy link
Collaborator

@evaline-ju evaline-ju left a comment

Choose a reason for hiding this comment

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

small q - otherwise LGTM

@evaline-ju evaline-ju merged commit d34987a into caikit:main Apr 3, 2024
5 checks passed
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.

None yet

2 participants