diff --git a/samples/c_cxx/model-explorer/batch-model-explorer.cpp b/samples/c_cxx/model-explorer/batch-model-explorer.cpp index c9f6dce245..71e374ae43 100644 --- a/samples/c_cxx/model-explorer/batch-model-explorer.cpp +++ b/samples/c_cxx/model-explorer/batch-model-explorer.cpp @@ -60,7 +60,14 @@ int main(int argc, char** argv) { cout << "Usage: ./onnx-api-example " << endl; return -1; } + +#ifdef _WIN32 + std::string str = argv[1]; + std::wstring wide_string = std::wstring(str.begin(), str.end()); + std::basic_string model_file = std::basic_string(wide_string); +#else std::string model_file = argv[1]; +#endif // onnxruntime setup Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "batch-model-explorer"); diff --git a/samples/c_cxx/model-explorer/model-explorer.cpp b/samples/c_cxx/model-explorer/model-explorer.cpp index 25c2dfdff4..b3f35df8fd 100644 --- a/samples/c_cxx/model-explorer/model-explorer.cpp +++ b/samples/c_cxx/model-explorer/model-explorer.cpp @@ -49,7 +49,14 @@ int main(int argc, char** argv) { cout << "Usage: ./onnx-api-example " << endl; return -1; } + +#ifdef _WIN32 + std::string str = argv[1]; + std::wstring wide_string = std::wstring(str.begin(), str.end()); + std::basic_string model_file = std::basic_string(wide_string); +#else std::string model_file = argv[1]; +#endif // onnxruntime setup Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "example-model-explorer");