Skip to content

Commit

Permalink
fix device bug
Browse files Browse the repository at this point in the history
  • Loading branch information
R1ckShi committed Jan 24, 2024
1 parent 1c8376e commit 972fa02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion funasr/auto/auto_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def build_model(self, **kwargs):
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
Expand Down

0 comments on commit 972fa02

Please sign in to comment.