Skip to content

Commit df40180

Browse files
authored
[CORE] Add MODEL_PTR to config only if plugin supports it (openvinotoolkit#29530)
### Tickets: - CVS-164470
1 parent d453981 commit df40180

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/inference/src/dev/core_impl.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -1478,16 +1478,16 @@ ov::SoPtr<ov::ICompiledModel> ov::CoreImpl::load_model_from_cache(
14781478
ov::AnyMap update_config = config;
14791479
update_config[ov::loaded_from_cache.name()] = true;
14801480

1481+
if (util::contains(plugin.get_property(ov::supported_properties), ov::hint::model) &&
1482+
cacheContent.model) {
1483+
update_config[ov::hint::model.name()] = cacheContent.model;
1484+
}
14811485
if (util::contains(plugin.get_property(ov::supported_properties), ov::weights_path)) {
1482-
if (cacheContent.model) {
1483-
update_config[ov::hint::model.name()] = cacheContent.model;
1484-
} else {
1485-
std::filesystem::path weights_path = cacheContent.modelPath;
1486-
weights_path.replace_extension(".bin");
1486+
std::filesystem::path weights_path = cacheContent.modelPath;
1487+
weights_path.replace_extension(".bin");
14871488

1488-
if (ov::util::file_exists(weights_path)) {
1489-
update_config[ov::weights_path.name()] = weights_path.string();
1490-
}
1489+
if (ov::util::file_exists(weights_path)) {
1490+
update_config[ov::weights_path.name()] = weights_path.string();
14911491
}
14921492
}
14931493
if (model_buffer) {

src/plugins/intel_gpu/src/plugin/plugin.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ std::vector<ov::PropertyName> Plugin::get_supported_properties() const {
605605
ov::PropertyName{ov::weights_path.name(), PropertyMutability::RW},
606606
ov::PropertyName{ov::cache_encryption_callbacks.name(), PropertyMutability::WO},
607607
ov::PropertyName{ov::hint::kv_cache_precision.name(), PropertyMutability::RW},
608+
ov::PropertyName{ov::hint::model.name(), PropertyMutability::WO},
608609
};
609610

610611
return supported_properties;

0 commit comments

Comments
 (0)