Skip to content

Commit 0e7153b

Browse files
bot0419jim60105
authored andcommitted
build: configure PyTorch sources for cross-platform compatibility
- macOS uses CPU-only PyTorch from pytorch-cpu index - Linux and Windows use CUDA 12.8 PyTorch from pytorch index - triton only installs on Linux with CUDA 12.8 support - Update lockfile to support multi-platform builds
1 parent 251602f commit 0e7153b

File tree

2 files changed

+233
-78
lines changed

2 files changed

+233
-78
lines changed

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"torch>=2.7.1",
2121
"torchaudio",
2222
"transformers>=4.48.0",
23-
"triton>=3.3.0; sys_platform != 'win32'" # avoid build issues on Windows
23+
"triton>=3.3.0; sys_platform == 'linux'" # only install triton on Linux
2424
]
2525

2626

@@ -39,16 +39,23 @@ include = ["whisperx*"]
3939

4040
[tool.uv.sources]
4141
torch = [
42-
{ index = "pytorch" },
42+
{ index = "pytorch-cpu", marker = "sys_platform == 'darwin'" },
43+
{ index = "pytorch", marker = "sys_platform != 'darwin'" },
4344
]
4445
torchaudio = [
45-
{ index = "pytorch" },
46+
{ index = "pytorch-cpu", marker = "sys_platform == 'darwin'" },
47+
{ index = "pytorch", marker = "sys_platform != 'darwin'" },
4648
]
4749
triton = [
48-
{ index = "pytorch" },
50+
{ index = "pytorch", marker = "sys_platform == 'linux'" },
4951
]
5052

5153
[[tool.uv.index]]
5254
name = "pytorch"
5355
url = "https://download.pytorch.org/whl/cu128"
5456
explicit = true
57+
58+
[[tool.uv.index]]
59+
name = "pytorch-cpu"
60+
url = "https://download.pytorch.org/whl/cpu"
61+
explicit = true

0 commit comments

Comments
 (0)