From d053dc0548f1cebce3cc1b431a212185e4e761c3 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Mon, 16 Dec 2024 19:29:20 +0800 Subject: [PATCH] fix bug --- .../core/providers/coreml/coreml_execution_provider.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/onnxruntime/core/providers/coreml/coreml_execution_provider.cc b/onnxruntime/core/providers/coreml/coreml_execution_provider.cc index 40f5ff09ae20a..226c844e9491e 100644 --- a/onnxruntime/core/providers/coreml/coreml_execution_provider.cc +++ b/onnxruntime/core/providers/coreml/coreml_execution_provider.cc @@ -70,6 +70,10 @@ CoreMLExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph_vie [](unsigned char c) { return !std::isalnum(c); })) { user_provided_key = std::to_string(std::hash{}(user_provided_key)); } + // invalid cache-key + if (user_provided_key.size() == 0){ + user_provided_key = std::to_string(model_hash); + } } else { // model_hash is a 64-bit hash value of model_path if model_path is not empty, // otherwise it hashes the graph input names and all the node output names.