Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olpipi committed Dec 9, 2024
1 parent 539a526 commit 8d0f56b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plugins/intel_cpu/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,12 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_str
decript_from_string = true;
}

auto _config = config;
std::shared_ptr<ov::AlignedBuffer> model_buffer;
if (config.count(ov::internal::cached_model_buffer.name()))
model_buffer = config.at(ov::internal::cached_model_buffer.name()).as<std::shared_ptr<ov::AlignedBuffer>>();
if (_config.count(ov::internal::cached_model_buffer.name())) {
model_buffer = _config.at(ov::internal::cached_model_buffer.name()).as<std::shared_ptr<ov::AlignedBuffer>>();
_config.erase(ov::internal::cached_model_buffer.name());
}

ModelDeserializer deserializer(
model_stream,
Expand All @@ -584,7 +587,6 @@ std::shared_ptr<ov::ICompiledModel> 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()) {
Expand Down

0 comments on commit 8d0f56b

Please sign in to comment.