diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts index 972c56677398f..4b882e5bc4951 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts @@ -789,5 +789,5 @@ export const getFieldByPathName = (fields: NormalizedFields, name: string) => { export function isLocalModel( model: InferenceServiceSettings ): model is LocalInferenceServiceSettings { - return Boolean((model as LocalInferenceServiceSettings).service_settings.model_id); + return ['elser', 'elasticsearch'].includes((model as LocalInferenceServiceSettings).service); } diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx index 38035990a8ec6..1b1cafc9880b6 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx @@ -231,7 +231,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{ .map((field) => field.inference_id) .filter( (inferenceId: string) => - state.inferenceToModelIdMap?.[inferenceId] && + state.inferenceToModelIdMap?.[inferenceId].trainedModelId && // third-party inference models don't have trainedModelId !state.inferenceToModelIdMap?.[inferenceId].isDeployed ); setHasSavedFields(true); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx index 6472b1d384e0c..e91ef6c88021d 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx @@ -101,9 +101,14 @@ export function TrainedModelsDeploymentModal({ useEffect(() => { const models = inferenceIdsInPendingList.map( (inferenceId) => inferenceToModelIdMap?.[inferenceId] - ); + ); // filter out third-party models for (const model of models) { - if (model && !model.isDownloading && !model.isDeployed) { + if ( + model?.trainedModelId && + model.isDeployable && + !model.isDownloading && + !model.isDeployed + ) { // Sometimes the model gets stuck in a ready to deploy state, so we need to trigger deployment manually startModelAllocation(model.trainedModelId); } diff --git a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts index e4cc3fa31dc10..79d4c8f79cf33 100644 --- a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts +++ b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts @@ -32,7 +32,7 @@ const getCustomInferenceIdMap = ( const inferenceIdMap = models.reduce((inferenceMap, model) => { const inferenceEntry = isLocalModel(model) ? { - trainedModelId: model.service_settings.model_id, // third-party models don't have trained model ids + trainedModelId: model.service_settings.model_id, isDeployable: model.service === Service.elser || model.service === Service.elasticsearch, isDeployed: modelStatsById[model.service_settings.model_id]?.state === 'started', isDownloading: Boolean(downloadStates[model.service_settings.model_id]),