-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre.js
22 lines (22 loc) · 880 Bytes
/
pre.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module.exports = (config, kernel) => {
const x = {
"win32": {
"nvidia": `pip install torch torchvision torchaudio ${config.xformers ? 'xformers' : ''} --index-url https://download.pytorch.org/whl/cu121`,
"amd": "pip install torch-directml",
"cpu": "pip install torch torchvision torchaudio"
},
"darwin": "pip install torch torchvision torchaudio",
"linux": {
"nvidia": `pip install torch torchvision torchaudio ${config.xformers ? 'xformers' : ''}`,
"amd": "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.7",
"cpu": "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
}
}
if (config.torch) {
if (kernel.platform === "darwin") {
return x[kernel.platform]
} else {
return x[kernel.platform][kernel.gpu]
}
}
}