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

[Enterprise Search] update supported ml models filter #141307

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ describe('ml inference utils', () => {
ner: {},
},
}),
makeFakeModel({
inference_config: {
classification: {},
},
}),
makeFakeModel({
inference_config: {
text_classification: {},
Expand All @@ -53,6 +48,16 @@ describe('ml inference utils', () => {
},
},
}),
makeFakeModel({
inference_config: {
question_answering: {},
},
}),
makeFakeModel({
inference_config: {
fill_mask: {},
},
}),
];

for (const model of models) {
Expand All @@ -61,7 +66,14 @@ describe('ml inference utils', () => {
});

it('returns false for expected models', () => {
const models: TrainedModelConfigResponse[] = [makeFakeModel({})];
const models: TrainedModelConfigResponse[] = [
makeFakeModel({}),
makeFakeModel({
inference_config: {
classification: {},
},
}),
];

for (const model of models) {
expect(isSupportedMLModel(model)).toBe(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_
import { AddInferencePipelineFormErrors, InferencePipelineConfiguration } from './types';

const NLP_CONFIG_KEYS = [
'fill_mask',
'ner',
'classification',
'text_classification',
'text_embedding',
'question_answering',
'zero_shot_classification',
];
export const isSupportedMLModel = (model: TrainedModelConfigResponse): boolean => {
Expand Down