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 29, 2024
1 parent 4f224c8 commit c47ad73
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions funasr/auto/auto_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ def __init__(self, **kwargs):
self.spk_model = spk_model
self.spk_kwargs = spk_kwargs
self.model_path = kwargs.get("model_path")



def build_model(self, **kwargs):
assert "model" in kwargs
Expand All @@ -146,7 +144,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) == 0:
if not torch.cuda.is_available() or kwargs.get("ngpu", 1) == 0:
device = "cpu"
kwargs["batch_size"] = 1
kwargs["device"] = device
Expand Down Expand Up @@ -200,8 +198,6 @@ def __call__(self, *args, **cfg):
res = self.model(*args, kwargs)
return res



def generate(self, input, input_len=None, **cfg):
if self.vad_model is None:
return self.inference(input, input_len=input_len, **cfg)
Expand Down

0 comments on commit c47ad73

Please sign in to comment.