Skip to content

Commit

Permalink
resolve the issue caused by another PR
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorSVC committed Mar 4, 2025
1 parent 175c1ed commit c86a126
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion onnxruntime/test/ep_weight_sharing_ctx_gen/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ int real_main(int argc, char* argv[]) {
std::vector<std::basic_string<ORTCHAR_T>> ep_ctx_files;
ep_ctx_files.reserve(test_config.model_file_paths.size());
for (auto model_path : test_config.model_file_paths) {
ep_ctx_files.push_back(model_path + ORT_TSTR("_ctx.onnx"));
auto pos = model_path.find_last_of(ORT_TSTR("."));
if (pos != std::string::npos) {
model_path = model_path.substr(0, pos) + ORT_TSTR("_ctx.onnx");
} else {
model_path = model_path + ORT_TSTR("_ctx.onnx");
}
ep_ctx_files.push_back(model_path);
}

// Get the last context binary file name
Expand Down

0 comments on commit c86a126

Please sign in to comment.