From e72d31840f56d3a6b96770e6b45a39d780289ff8 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 30 Jan 2025 13:59:19 -0500 Subject: [PATCH] Avoid fallback to PyPI in mixed CPU/CUDA example --- docs/guides/integration/pytorch.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/integration/pytorch.md b/docs/guides/integration/pytorch.md index 4113bc0663cd7..0828aa76ceda8 100644 --- a/docs/guides/integration/pytorch.md +++ b/docs/guides/integration/pytorch.md @@ -252,8 +252,8 @@ In some cases, you may want to use CPU-only builds in one environment (e.g., mac CUDA-enabled builds in another (e.g., Linux). With `tool.uv.sources`, you can use environment markers to specify the desired index for each -platform. For example, the following configuration would use PyTorch's CPU-only builds on Windows -(and macOS, by way of falling back to PyPI), and CUDA-enabled builds on Linux: +platform. For example, the following configuration would use PyTorch's CUDA-enabled builds on Linux, +and CPU-only builds on all other platforms (e.g., macOS and Windows): ```toml [project] @@ -267,11 +267,11 @@ dependencies = [ [tool.uv.sources] torch = [ - { index = "pytorch-cpu", marker = "sys_platform == 'win32'" }, + { index = "pytorch-cpu", marker = "sys_platform != 'linux'" }, { index = "pytorch-cu124", marker = "sys_platform == 'linux'" }, ] torchvision = [ - { index = "pytorch-cpu", marker = "sys_platform == 'win32'" }, + { index = "pytorch-cpu", marker = "sys_platform != 'linux'" }, { index = "pytorch-cu124", marker = "sys_platform == 'linux'" }, ]