-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Enterprise Search] Replace model selection dropdown with list #171436
Conversation
{ | ||
disabled: true, | ||
inputDisplay: | ||
existingPipeline && pipelineName.length > 0 | ||
? MODEL_REDACTED_VALUE | ||
: MODEL_SELECT_PLACEHOLDER, | ||
value: MODEL_SELECT_PLACEHOLDER_VALUE, | ||
}, |
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.
This logic can be safely removed:
- The "Select model" placeholder is no longer relevant in the selection list component
- The new/existing pipeline choice has been split into separate tabs. Therefore if an existing pipeline is selected with a redacted model, the model selection component won't be rendered in that tab, and there's no need for supporting the disabled placeholder.
...ns/enterprise_search_content/components/search_index/pipelines/ml_inference/model_select.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
3 similar comments
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
a7bdae7
to
1f07826
Compare
@@ -43,7 +43,7 @@ export const startMlModelDeployment = async ( | |||
// we're downloaded already, but not deployed yet - let's deploy it | |||
const startRequest: MlStartTrainedModelDeploymentRequest = { | |||
model_id: modelName, | |||
wait_for: 'started', | |||
wait_for: 'starting', |
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.
This change has a minor side effect - the ELSER callout's "Start single-threaded" button will turn the status into "started" while the model is starting. This is fine for two reasons:
- Starting the ELSER model takes about a second, so it is very unlikely the user will run a pipeline with the model in the starting phase;
- Currently the status label displays "started" both for the "starting" and "started" phase in the ELSER callout.
case TrainedModelState.NotDeployed: | ||
case MlModelDeploymentState.NotDeployed: |
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.
Accommodating for the broader spectrum of status values of MlModelDeploymentState
while maintaining backward compatibility with other components that still use TrainedModelState
.
...ise_search_content/components/search_index/pipelines/ml_inference/model_select_logic.test.ts
Show resolved
Hide resolved
...rprise_search_content/components/search_index/pipelines/ml_inference/model_select_option.tsx
Outdated
Show resolved
Hide resolved
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
{/* Status indicator OR action button */} |
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.
rather than a comment it would make more sense to move this to a component with a descriptive name.
But that maybe a personal preference thing, comments in JSX seem like a code smell to me, but I could be wrong there, @sphilipse ?
/> | ||
)} | ||
</EuiFlexItem> | ||
{/* Actions menu */} |
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.
same here if you want the comment, make a custom component.
…astic/kibana into demjened/model-selection-list
@elasticmachine merge upstream |
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.
Partial review, can finish later this afternoon
...terprise_search_content/components/search_index/pipelines/ml_inference/model_select.test.tsx
Outdated
Show resolved
Hide resolved
...ns/enterprise_search_content/components/search_index/pipelines/ml_inference/model_select.tsx
Show resolved
Hide resolved
...ns/enterprise_search_content/components/search_index/pipelines/ml_inference/model_select.tsx
Outdated
Show resolved
Hide resolved
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! We can address my comments after FF :)
(models ?? []).map((model) => ({ | ||
...model, | ||
label: model.modelId, | ||
checked: model.modelId === modelID ? 'on' : undefined, |
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.
I'm seeing a lot of warnings in my developer console when the list is rendered (see the attached log). I believe it's due to the prop names introduced here by MlModel
.
I was wondering why PipelineSelectOptionProps
was structured like it is, I think this is why...
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.
Yeah, I've seen those too - no idea why React is complaining. I surely don't want to lowercase all props just to fix that 😅
Maybe @TattdCodeMonkey knows why this is happening?
Example warning:
react-dom.development.js:67 Warning: React does not recognize the `deploymentState` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `deploymentstate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
description: i18n.translate('xpack.enterpriseSearch.modelCard.elserPlaceholder.description', { | ||
defaultMessage: | ||
'ELSER is designed to efficiently use context in natural language queries with better results than BM25 alone.', | ||
"ELSER is Elastic's NLP model for English semantic search, utilizing sparse vectors. It prioritizes intent and contextual meaning over literal term matching, optimized specifically for English documents and queries on the Elastic platform.", |
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.
(Hopefully) dumb question: Do we need to make any changes to the files in translations/
to propagate this change?
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
## Summary We are removing the E5 model deployment callout from the Pipelines tab in favor of the model selector list with action buttons (#171436). The orphan code cleanup will happen in a separate PR. <img width="636" alt="Screenshot 2023-12-04 at 14 18 43" src="https://github.com/elastic/kibana/assets/14224983/1b0fbce1-34aa-44d4-a9b9-f783761ea2bd">
Summary
This PR replaces the model selection dropdown in the ML inference pipeline configuration flyout with a cleaner selection list. The model cards also contain fast deploy action buttons for promoted models (ELSER, E5). The list is periodically updated.
Old:
New:
Checklist