diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 96f4882e82..f29229dc56 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -576,9 +576,10 @@ std::unique_ptr CreateExecutionProviderInstance( } } } + auto p = onnxruntime::CreateExecutionProviderFactory_OpenVINO(¶ms)->CreateProvider(); // Reset global variables config to avoid it being accidentally passed on to the next session openvino_device_type.clear(); - return onnxruntime::CreateExecutionProviderFactory_OpenVINO(¶ms)->CreateProvider(); + return p; #endif } else if (type == kNupharExecutionProvider) { #if USE_NUPHAR