Spaces:
Configuration error
Configuration error
add (#11)
Browse files- add (409827b236c9d2a847e2596cc42494431f4914a0)
Co-authored-by: Morpheus <[email protected]>
torch.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module.exports = {
|
| 2 |
+
run: [
|
| 3 |
+
// nvidia 50 series
|
| 4 |
+
{
|
| 5 |
+
"when": "{{gpu === 'nvidia' && kernel.gpus && kernel.gpus.find(x => / 50.+/.test(x.model))}}",
|
| 6 |
+
"method": "shell.run",
|
| 7 |
+
"params": {
|
| 8 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 9 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 10 |
+
"message": "uv pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128"
|
| 11 |
+
},
|
| 12 |
+
"next": null
|
| 13 |
+
},
|
| 14 |
+
// windows nvidia
|
| 15 |
+
{
|
| 16 |
+
"when": "{{platform === 'win32' && gpu === 'nvidia'}}",
|
| 17 |
+
"method": "shell.run",
|
| 18 |
+
"params": {
|
| 19 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 20 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 21 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio {{args && args.xformers ? 'xformers' : ''}} --index-url https://download.pytorch.org/whl/cu124"
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
// windows amd
|
| 25 |
+
{
|
| 26 |
+
"when": "{{platform === 'win32' && gpu === 'amd'}}",
|
| 27 |
+
"method": "shell.run",
|
| 28 |
+
"params": {
|
| 29 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 30 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 31 |
+
"message": "uv pip install torch-directml torchaudio torchvision numpy==1.26.4"
|
| 32 |
+
}
|
| 33 |
+
},
|
| 34 |
+
// windows cpu
|
| 35 |
+
{
|
| 36 |
+
"when": "{{platform === 'win32' && (gpu !== 'nvidia' && gpu !== 'amd')}}",
|
| 37 |
+
"method": "shell.run",
|
| 38 |
+
"params": {
|
| 39 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 40 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 41 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
// apple mac
|
| 45 |
+
{
|
| 46 |
+
"when": "{{platform === 'darwin' && arch === 'arm64'}}",
|
| 47 |
+
"method": "shell.run",
|
| 48 |
+
"params": {
|
| 49 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 50 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 51 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
// intel mac
|
| 55 |
+
{
|
| 56 |
+
"when": "{{platform === 'darwin' && arch !== 'arm64'}}",
|
| 57 |
+
"method": "shell.run",
|
| 58 |
+
"params": {
|
| 59 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 60 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 61 |
+
"message": "uv pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cpu"
|
| 62 |
+
}
|
| 63 |
+
},
|
| 64 |
+
// linux nvidia
|
| 65 |
+
{
|
| 66 |
+
"when": "{{platform === 'linux' && gpu === 'nvidia'}}",
|
| 67 |
+
"method": "shell.run",
|
| 68 |
+
"params": {
|
| 69 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 70 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 71 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio {{args && args.xformers ? 'xformers' : ''}} --index-url https://download.pytorch.org/whl/cu124"
|
| 72 |
+
}
|
| 73 |
+
},
|
| 74 |
+
// linux rocm (amd)
|
| 75 |
+
{
|
| 76 |
+
"when": "{{platform === 'linux' && gpu === 'amd'}}",
|
| 77 |
+
"method": "shell.run",
|
| 78 |
+
"params": {
|
| 79 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 80 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 81 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4"
|
| 82 |
+
}
|
| 83 |
+
},
|
| 84 |
+
// linux cpu
|
| 85 |
+
{
|
| 86 |
+
"when": "{{platform === 'linux' && (gpu !== 'amd' && gpu !=='nvidia')}}",
|
| 87 |
+
"method": "shell.run",
|
| 88 |
+
"params": {
|
| 89 |
+
"venv": "{{args && args.venv ? args.venv : null}}",
|
| 90 |
+
"path": "{{args && args.path ? args.path : '.'}}",
|
| 91 |
+
"message": "uv pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
]
|
| 95 |
+
}
|