Remove hardcoded references to torch.cuda; Use torchruntime and sdkit's device utilities instead

This commit is contained in:
cmdr2
2025-02-06 13:06:51 +05:30
parent 2e4623736a
commit cd8365558a
7 changed files with 83 additions and 177 deletions

View File

@ -642,7 +642,7 @@ function setDeviceInfo(devices) {
function ID_TO_TEXT(d) {
let info = devices.all[d]
if ("mem_free" in info && "mem_total" in info) {
if ("mem_free" in info && "mem_total" in info && info["mem_total"] > 0) {
return `${info.name} <small>(${d}) (${info.mem_free.toFixed(1)}Gb free / ${info.mem_total.toFixed(
1
)} Gb total)</small>`