Explorar o código

fix device bug

shixian.shi %!s(int64=2) %!d(string=hai) anos
pai
achega
972fa020fc
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      funasr/auto/auto_model.py

+ 1 - 1
funasr/auto/auto_model.py

@@ -146,7 +146,7 @@ class AutoModel:
         set_all_random_seed(kwargs.get("seed", 0))
         
         device = kwargs.get("device", "cuda")
-        if not torch.cuda.is_available() or kwargs.get("ngpu", 0):
+        if not torch.cuda.is_available() or kwargs.get("ngpu", 0) == 0:
             device = "cpu"
             kwargs["batch_size"] = 1
         kwargs["device"] = device