Skip to content

Expansion support #740

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

Merged
merged 12 commits into from
Nov 22, 2024
Merged

Expansion support #740

merged 12 commits into from
Nov 22, 2024

Conversation

daixque
Copy link
Contributor

@daixque daixque commented Nov 21, 2024

Overview

This pull request introduces a new model type for text_expansion which is related to Sparse vector query .
Until Elasticsearch and Eland 8.16, only ELSER model can be used for this query type, but with this PR and this, users can upload other sparse vector model from hugging face such as:

This is essentially the same PR as #706 but I fixed formatter issue.

Related:


This pull request introduces a new model type for text expansion and refines error messaging for unsupported task types. The most important changes include the addition of the _TraceableTextExpansionModel class and updates to the _create_traceable_model method to handle this new model type.

New Model Type for Text Expansion:

  • Added the _TraceableTextExpansionModel class with a _prepare_inputs method to handle text expansion tasks. (eland/ml/pytorch/transformers.py)
  • Updated the _create_traceable_model method to include logic for creating a _TraceableTextExpansionModel when the task type is "text_expansion". (eland/ml/pytorch/transformers.py)

Error Messaging Improvement:

  • Refined the error message in _create_traceable_model to clarify that the task type must be one of the supported task types. (eland/ml/pytorch/transformers.py)

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

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.

3 participants