def _get_onnx_provider(device: str) -> str:
    """determine where the model should run based on specified device
    """
    onnxproviders = onnxruntime.get_available_providers()
    logger.info(f"device:{device} and available providers {onnxproviders}")
    if device == 'cpu':
        fast_onnxprovider = 'CPUExecutionProvider'
    else:
        if 'CUDAExecutionProvider' not in onnxproviders:
            fast_onnxprovider = 'CPUExecutionProvider'
        else:
            fast_onnxprovider = 'CUDAExecutionProvider'

    logger.info(f"onnx_provider:{fast_onnxprovider}")
    return fast_onnxprovider
determine where the model should run based on specified device
    
src/marqo/s2_inference/processing/image_utils.py