-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Adding support for binary embedding type to Cohere service embedding type #120751
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
Conversation
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.
Nice!
This looks good to merge, please make it a non draft PR when you are ready.
If it is simple to add in this PR then Jina AI also have binary embeddings. They have a good blog at https://jina.ai/news/binary-embeddings-all-the-ai-3125-of-the-fat/
...ore/src/main/java/org/elasticsearch/xpack/core/inference/results/InferenceByteEmbedding.java
Outdated
Show resolved
Hide resolved
…inference/results/InferenceByteEmbedding.java Co-authored-by: David Kyle <[email protected]>
Hi @ymao1, I've created a changelog YAML for you. |
I will do this in a follow-up PR! |
It looks like this PR modifies one or more |
Reverted the docs change due to the docs freeze, looks like I'll have to create a PR to 8.x for the asciidocs change and then an issue in https://github.com/elastic/docs-content/issues to get the docs update to 9.0 |
Pinging @elastic/ml-core (Team:ML) |
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.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Documentation request made in elastic/docs-content#310 |
…dding type (#120751) (#121584) * Adding support for binary embedding type to Cohere service embedding type (#120751) * Adding support for binary embedding type to Cohere service embedding type * Returning response in separate text_embedding_bits field * Update x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/InferenceByteEmbedding.java Co-authored-by: David Kyle <[email protected]> * Update docs/changelog/120751.yaml * Reverting docs change --------- Co-authored-by: David Kyle <[email protected]> (cherry picked from commit 89d71e1) # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/InferenceTextEmbeddingByteResults.java * Adding docs
Towards #111747
Summary
Adds support for binary embedding type in the Cohere
text_embedding
task.Usage
Notes
Requesting a binary embedding from Cohere returns an array of binary embeddings encoded as bytes with
int8
precision. Since this aligns with what is expected as input when you specify adense_vector
mapping withelement_type: bit
, we do not perform any bit unpacking on the Cohere response and handle the bytes as-is.