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

Extract common ServiceSettings methods #105553

Conversation

carlosdelest
Copy link
Member

This is previous work for #105515.

Refactor out some common methods in ServiceSettings class so they are available for serialization as part of inference results in semantic_text.

When serializing dense vectors, inference results for semantic_text must include similarity and dimensions so the underlying field mapping can be properly created.

A new class is created to just serialize the information needed from ServiceSettings. This means moving SimilarityMeasure to server code so it's available there as well.

@@ -252,7 +251,7 @@ public void chunkedInfer(

var configUpdate = chunkingOptions.settingsArePresent()
? new TokenizationConfigUpdate(chunkingOptions.windowSize(), chunkingOptions.span())
: TextExpansionConfigUpdate.EMPTY_UPDATE;
: TextEmbeddingConfigUpdate.EMPTY_INSTANCE;
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed this bug for inference

@carlosdelest carlosdelest marked this pull request as ready for review February 15, 2024 18:15
@carlosdelest carlosdelest added >refactoring :ml Machine learning Team:ML Meta label for the ML team labels Feb 15, 2024
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label and removed needs:triage Requires assignment of a team area label labels Feb 15, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@carlosdelest carlosdelest merged commit 1b7f3a0 into elastic:main Feb 20, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning >refactoring Team:ML Meta label for the ML team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants