Skip to content

Commit 8fc21b1

Browse files
authored
Merge branch 'ovep-develop' into preetha/get_capability
2 parents cb5dd98 + 6aa8420 commit 8fc21b1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ BackendManager::BackendManager(SessionContext& session_context,
9090
"[OpenVINO-EP] Bounded dynamic model execution using provider option reshape_input is not supported for OVEP EPContext model";
9191
ORT_THROW(exception_str);
9292
}
93-
model_stream = ep_ctx_handle_.GetModelBlobStream(session_context_.so_context_file_path, subgraph);
93+
if (subgraph_context_.is_ep_ctx_ovir_encapsulated) {
94+
model_stream = ep_ctx_handle_.GetModelBlobStream(session_context_.onnx_model_path_name.replace_extension("xml").string(), subgraph);
95+
} else {
96+
model_stream = ep_ctx_handle_.GetModelBlobStream(session_context_.so_context_file_path, subgraph);
97+
}
98+
9499
} else {
95100
model_proto = GetModelProtoFromFusedNode(fused_node, subgraph, logger);
96101
}
@@ -236,7 +241,9 @@ Status BackendManager::ExportCompiledBlobAsEPCtxNode(const onnxruntime::GraphVie
236241
std::ofstream blob_file(blob_filename,
237242
std::ios::out | std::ios::trunc | std::ios::binary);
238243
if (!blob_file) {
239-
ORT_THROW("Unable to open file for epctx model dump.");
244+
std::ostringstream err_msg;
245+
err_msg << "Unable to open file for epctx model dump: " << blob_filename;
246+
ORT_THROW(err_msg.str());
240247
}
241248
compiled_model.export_model(blob_file);
242249
model_blob_str = blob_filename.filename().string();

0 commit comments

Comments
 (0)