Skip to content

Commit dfc8ff0

Browse files
authored
Fix metadata name when ep.context_file_path is not provided (#722)
1 parent 7f86fad commit dfc8ff0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

onnxruntime/core/providers/openvino/openvino_execution_provider.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,12 @@ common::Status OpenVINOExecutionProvider::Compile(
190190
fs::path metadata_file_path = shared_context_->shared_weights.metadata_filepath;
191191
if (metadata_file_path.empty()) {
192192
metadata_file_path = session_context_.so_context_file_path;
193+
std::string name_append{"_metadata.bin"};
193194
if (metadata_file_path.empty()) {
194195
metadata_file_path = session_context_.onnx_model_path_name;
196+
name_append = "_ctx" + name_append;
195197
}
196-
auto metadata_filename = metadata_file_path.stem().string() + "_metadata.bin";
198+
auto metadata_filename = metadata_file_path.stem().string() + name_append;
197199
metadata_file_path.replace_filename(metadata_filename);
198200
shared_context_->shared_weights.metadata_filepath = metadata_file_path;
199201
}

0 commit comments

Comments
 (0)