From 972fa020fc1b57997845832cb443aaedab0f6700 Mon Sep 17 00:00:00 2001
From: shixian.shi <shixian.shi@alibaba-inc.com>
Date: 星期三, 24 一月 2024 17:34:49 +0800
Subject: [PATCH] fix device bug

---
 funasr/auto/auto_model.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index f724650..5f89dd6 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -146,7 +146,7 @@
         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

--
Gitblit v1.9.1