def load_model(path: Union[str, Path], provider=None, sess_options=None, provider_options=None):
        """
        Loads an ONNX Inference session with an ExecutionProvider. Default provider is `CPUExecutionProvider`

        Arguments:
            path (`str` or `Path`):
                Directory from which to load
            provider(`str`, *optional*):
                Onnxruntime execution provider to use for loading the model, defaults to `CPUExecutionProvider`
        """
        if provider is None:
            logger.info("No onnxruntime provider specified, using CPUExecutionProvider")
            provider = "CPUExecutionProvider"

        if provider_options is None:
            provider_options = []
        elif not isinstance(provider_options, list):
            provider_options = [provider_options]

        return ort.InferenceSession(
            path, providers=[provider], sess_options=sess_options, provider_options=provider_options
        )

        Loads an ONNX Inference session with an ExecutionProvider. Default provider is `CPUExecutionProvider`

        Arguments:
            path (`str` or `Path`):
                Directory from which to load
            provider(`str`, *optional*):
                Onnxruntime execution provider to use for loading the model, defaults to `CPUExecutionProvider`
        
src/diffusers/pipelines/onnx_utils.py