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

[ML] add default inference config to lang ident model #65986

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -104,8 +104,8 @@ public final class Messages {
"Configuration [{0}] requires minimum node version [{1}] (current minimum node version [{2}]";
public static final String MODEL_DEFINITION_NOT_FOUND = "Could not find trained model definition [{0}]";
public static final String MODEL_METADATA_NOT_FOUND = "Could not find trained model metadata {0}";
public static final String INFERENCE_CANNOT_DELETE_MODEL =
"Unable to delete model [{0}]";
public static final String INFERENCE_CANNOT_DELETE_ML_MANAGED_MODEL =
"Unable to delete model [{0}] as it is required by machine learning";
public static final String MODEL_DEFINITION_TRUNCATED =
"Model definition truncated. Unable to deserialize trained model definition [{0}]";
public static final String INFERENCE_FAILED_TO_DESERIALIZE = "Could not deserialize trained model [{0}]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public void getTrainedModels(Set<String> modelIds,

public void deleteTrainedModel(String modelId, ActionListener<Boolean> listener) {
if (MODELS_STORED_AS_RESOURCE.contains(modelId)) {
listener.onFailure(ExceptionsHelper.badRequestException(Messages.getMessage(Messages.INFERENCE_CANNOT_DELETE_MODEL, modelId)));
listener.onFailure(ExceptionsHelper.badRequestException(Messages.getMessage(Messages.INFERENCE_CANNOT_DELETE_ML_MANAGED_MODEL, modelId)));
return;
}
DeleteByQueryRequest request = new DeleteByQueryRequest().setAbortOnVersionConflict(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"text"
]
},
"inference_config" : {"classification" : {}},
"estimated_heap_memory_usage_bytes" : 1053992,
"estimated_operations" : 39629,
"license_level" : "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testDeleteModelStoredAsResource() {
// Should be OK as we don't make any client calls
trainedModelProvider.deleteTrainedModel("lang_ident_model_1", future);
ElasticsearchException ex = expectThrows(ElasticsearchException.class, future::actionGet);
assertThat(ex.getMessage(), equalTo(Messages.getMessage(Messages.INFERENCE_CANNOT_DELETE_MODEL, "lang_ident_model_1")));
assertThat(ex.getMessage(), equalTo(Messages.getMessage(Messages.INFERENCE_CANNOT_DELETE_ML_MANAGED_MODEL, "lang_ident_model_1")));
}

public void testPutModelThatExistsAsResource() {
Expand Down