// Platform-aware PyTorch installer. // CUDA 12.8 wheels for NVIDIA, DirectML for AMD, CPU fallback. module.exports = { run: [ // Windows + NVIDIA { "when": "{{platform === 'win32' && gpu === 'nvidia'}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: [ "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu128 --force-reinstall" ] }, next: null }, // Windows + AMD (DirectML) { "when": "{{platform === 'win32' && gpu === 'amd'}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: "uv pip install torch-directml torchaudio torchvision --force-reinstall" }, next: null }, // Windows CPU { "when": "{{platform === 'win32' && (gpu !== 'nvidia' && gpu !== 'amd')}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall" }, next: null }, // macOS (CPU only — Apple Silicon uses MPS automatically) { "when": "{{platform === 'darwin'}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall" }, next: null }, // Linux + NVIDIA { "when": "{{platform === 'linux' && gpu === 'nvidia'}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: [ "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu128 --force-reinstall" ] }, next: null }, // Linux + AMD (ROCm 6.4) { "when": "{{platform === 'linux' && gpu === 'amd'}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/rocm6.4 --force-reinstall" }, next: null }, // Linux CPU { "when": "{{platform === 'linux' && (gpu !== 'amd' && gpu !== 'nvidia')}}", method: "shell.run", params: { venv: "{{args.venv}}", path: "{{args.path}}", message: "uv pip install torch==2.11.0 torchvision==0.21.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall" } } ] }