Skip to content

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Mar 21, 2025

Backport of #125370 to 9.0

Cohere embeddings are expected to be normalized to unit vectors, but due to floating point precision issues,
our check ({@link DenseVectorFieldMapper#isNotUnitVector(float)}) often fails.
This change fixes this bug by setting the default similarity for newly created Cohere inference endpoint to cosine.

Closes elastic#122878
@jimczi jimczi added >bug :ml Machine learning backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v9.0.1 labels Mar 21, 2025
@elasticsearchmachine elasticsearchmachine merged commit 2a65ef5 into elastic:9.0 Mar 21, 2025
16 checks passed
@jimczi jimczi deleted the backport_125370_9_0 branch March 21, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :ml Machine learning v9.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants