-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[ML] Fixing missing multi label checkbox and basic input validation #145357
[ML] Fixing missing multi label checkbox and basic input validation #145357
Conversation
Pinging @elastic/ml-ui (: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, left a couple of suggestions
.../ml/public/application/trained_models/models_management/test_models/models/inference_base.ts
Outdated
Show resolved
Hide resolved
...dels/models_management/test_models/models/question_answering/question_answering_inference.ts
Outdated
Show resolved
Hide resolved
...ained_models/models_management/test_models/models/text_embedding/text_embedding_inference.ts
Outdated
Show resolved
Hide resolved
helpText={i18n.translate( | ||
'xpack.ml.trainedModels.testModelsFlyout.textClassification.multiLabelHelpText', | ||
{ | ||
defaultMessage: 'Is there a possibility of more than one correct label', |
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 needs a ?
at the end of the sentence. Or alternatively from the docs Indicates if more than one true label is possible given the input.
Any thoughts @szabosteve ?
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.
Yup, it's not trivial to explain it in one line. I leave a few suggestions:
Enable the input text to have more than one label.
Enable the input text to match more than one label.
What do you think?
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.
Updated to Enable the input text to match more than one label.
13a20c0
.../ml/public/application/trained_models/models_management/test_models/models/inference_base.ts
Outdated
Show resolved
Hide resolved
private validators$: Array<Observable<boolean>> = []; | ||
private validatorsSubscriptions$: Subscription = new Subscription(); | ||
|
||
private pipeline = new BehaviorSubject<estypes.IngestPipeline>({}); |
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 reckon we should follow the same naming convention for observables/subjects
private pipeline = new BehaviorSubject<estypes.IngestPipeline>({}); | |
private pipeline$ = new BehaviorSubject<estypes.IngestPipeline>({}); |
) | ||
.subscribe((v) => { | ||
this.isValid$.next(v); | ||
this.pipeline.next(this.generatePipeline()); |
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 think we should not mix validation logic with something else. Also here you generate a pipeline no matter if the input is valid or not.
If I understand it correctly, the pipeline only depends on the model id and some additional params
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.
Latest changes LGTM
@@ -34,31 +34,35 @@ export const InferenceInputFormIndexControls: FC<Props> = ({ inferrer, data }) = | |||
} = data; | |||
|
|||
const runningState = useObservable(inferrer.getRunningState$()); | |||
const pipeline = useObservable(inferrer.getPipeline$()); |
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.
you also need an initial value
const pipeline = useObservable(inferrer.getPipeline$()); | |
const pipeline = useObservable(inferrer.getPipeline$(), inferrer.getPipeline()); |
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.
Updated in d70170f
); | ||
} | ||
|
||
private initializePipeline(additionalChanges?: Array<Observable<any>>) { |
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.
private initializePipeline(additionalChanges?: Array<Observable<any>>) { | |
private initializePipeline(additionalChanges?: Array<Observable<unknown>>) { |
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.
Updated in 639f57b
} | ||
|
||
private initializePipeline(additionalChanges?: Array<Observable<any>>) { | ||
const formObservables$: Array<Observable<any>> = [ |
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.
const formObservables$: Array<Observable<any>> = [ | |
const formObservables$: Array<Observable<unknown>> = [ |
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.
Updated in d70170f
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.
Tested latest changes and LGTM
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.
UI text LGTM.
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…lastic#145357) The `multi_label` flag for question answering models should be user configurable. Adds a multi label switch to the zero shot classification testing UI. ![image](https://user-images.githubusercontent.com/22172091/202193314-6262247b-0fef-44f0-b0d4-c62fe14e2cba.png) Adds basic input validation to ensure the Test button is not enabled unless all required inputs are filled in. For `fill_mask` that includes every string needing contain the `[MASK]` keyword. Also fixes the `Test model` menu item to ensure it is disabled if `PyTorch` models not started. ![image](https://user-images.githubusercontent.com/22172091/202516808-e48e5bc0-b7b7-4864-a94b-cec2c27b7724.png) Also fixes generated pipeline to ensure it's always up to date with the user's selections. (cherry picked from commit a929099)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
…tion (#145357) (#145735) # Backport This will backport the following commits from `main` to `8.6`: - [[ML] Fixing missing multi label checkbox and basic input validation (#145357)](#145357) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"James Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2022-11-18T13:58:32Z","message":"[ML] Fixing missing multi label checkbox and basic input validation (#145357)\n\nThe `multi_label` flag for question answering models should be user\r\nconfigurable.\r\nAdds a multi label switch to the zero shot classification testing UI.\r\n\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202193314-6262247b-0fef-44f0-b0d4-c62fe14e2cba.png)\r\n\r\nAdds basic input validation to ensure the Test button is not enabled\r\nunless all required inputs are filled in.\r\nFor `fill_mask` that includes every string needing contain the `[MASK]`\r\nkeyword.\r\n\r\nAlso fixes the `Test model` menu item to ensure it is disabled if\r\n`PyTorch` models not started.\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202516808-e48e5bc0-b7b7-4864-a94b-cec2c27b7724.png)\r\n\r\nAlso fixes generated pipeline to ensure it's always up to date with the\r\nuser's selections.","sha":"a929099c9e80c9bd31bbbc34b3bf3450e016bcbc","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["non-issue",":ml","release_note:skip","Feature:3rd Party Models","v8.6.0","v8.7.0"],"number":145357,"url":"https://github.com/elastic/kibana/pull/145357","mergeCommit":{"message":"[ML] Fixing missing multi label checkbox and basic input validation (#145357)\n\nThe `multi_label` flag for question answering models should be user\r\nconfigurable.\r\nAdds a multi label switch to the zero shot classification testing UI.\r\n\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202193314-6262247b-0fef-44f0-b0d4-c62fe14e2cba.png)\r\n\r\nAdds basic input validation to ensure the Test button is not enabled\r\nunless all required inputs are filled in.\r\nFor `fill_mask` that includes every string needing contain the `[MASK]`\r\nkeyword.\r\n\r\nAlso fixes the `Test model` menu item to ensure it is disabled if\r\n`PyTorch` models not started.\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202516808-e48e5bc0-b7b7-4864-a94b-cec2c27b7724.png)\r\n\r\nAlso fixes generated pipeline to ensure it's always up to date with the\r\nuser's selections.","sha":"a929099c9e80c9bd31bbbc34b3bf3450e016bcbc"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145357","number":145357,"mergeCommit":{"message":"[ML] Fixing missing multi label checkbox and basic input validation (#145357)\n\nThe `multi_label` flag for question answering models should be user\r\nconfigurable.\r\nAdds a multi label switch to the zero shot classification testing UI.\r\n\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202193314-6262247b-0fef-44f0-b0d4-c62fe14e2cba.png)\r\n\r\nAdds basic input validation to ensure the Test button is not enabled\r\nunless all required inputs are filled in.\r\nFor `fill_mask` that includes every string needing contain the `[MASK]`\r\nkeyword.\r\n\r\nAlso fixes the `Test model` menu item to ensure it is disabled if\r\n`PyTorch` models not started.\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/202516808-e48e5bc0-b7b7-4864-a94b-cec2c27b7724.png)\r\n\r\nAlso fixes generated pipeline to ensure it's always up to date with the\r\nuser's selections.","sha":"a929099c9e80c9bd31bbbc34b3bf3450e016bcbc"}}]}] BACKPORT--> Co-authored-by: James Gowdy <jgowdy@elastic.co>
The
multi_label
flag for question answering models should be user configurable.Adds a multi label switch to the zero shot classification testing UI.
Adds basic input validation to ensure the Test button is not enabled unless all required inputs are filled in.
For
fill_mask
that includes every string needing contain the[MASK]
keyword.Also fixes the
Test model
menu item to ensure it is disabled ifPyTorch
models not started.Also fixes generated pipeline to ensure it's always up to date with the user's selections.