diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index 264c7a4a038243..33cb87b337bfef 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -565,9 +565,12 @@ std::shared_ptr Plugin::import_model(std::istream& model_str decript_from_string = true; } + auto _config = config; std::shared_ptr model_buffer; - if (config.count(ov::internal::cached_model_buffer.name())) - model_buffer = config.at(ov::internal::cached_model_buffer.name()).as>(); + if (_config.count(ov::internal::cached_model_buffer.name())) { + model_buffer = _config.at(ov::internal::cached_model_buffer.name()).as>(); + _config.erase(ov::internal::cached_model_buffer.name()); + } ModelDeserializer deserializer( model_stream, @@ -584,7 +587,6 @@ std::shared_ptr Plugin::import_model(std::istream& model_str Config::ModelType modelType = getModelType(model); conf.applyRtInfo(model); // check ov::loaded_from_cache property and erase it to avoid exception in readProperties. - auto _config = config; const auto& it = _config.find(ov::loaded_from_cache.name()); bool loaded_from_cache = false; if (it != _config.end()) {