From bed169192de4a69f0c0d39d83f18bb4c772f82f9 Mon Sep 17 00:00:00 2001 From: Adam Louly Date: Thu, 20 Oct 2022 09:58:02 -0700 Subject: [PATCH] Windows build fix for on device training training. (#13354) ### Description This is a fix for on device training wheel build. ### Motivation and Context when building linux wheel it treats PathString same as std::string, but when trying to build the wheel on windows it fails because we needed to cast the std::string to a PathString. This error was found manually because there is no pipeline that uses the --enable_training_on_device for windows. Co-authored-by: Adam Louly --- orttraining/orttraining/python/orttraining_pybind_state.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orttraining/orttraining/python/orttraining_pybind_state.cc b/orttraining/orttraining/python/orttraining_pybind_state.cc index e68d25d4d2..ebd73798f4 100644 --- a/orttraining/orttraining/python/orttraining_pybind_state.cc +++ b/orttraining/orttraining/python/orttraining_pybind_state.cc @@ -870,7 +870,7 @@ void addObjectMethodsForTraining(py::module& m, ExecutionProviderRegistrationFn checkpoint_state.def(py::init([]( const std::string& ckpt_uri) { onnxruntime::training::api::CheckpointState state; - ORT_THROW_IF_ERROR(onnxruntime::training::api::LoadCheckpoint(ckpt_uri, state)); + ORT_THROW_IF_ERROR(onnxruntime::training::api::LoadCheckpoint(ToPathString(ckpt_uri), state)); return state; }));