From 28e040372f72578912c80dfee7f924aaa21ad0ff Mon Sep 17 00:00:00 2001 From: Peng Wei Date: Tue, 25 Jun 2024 09:24:33 -0700 Subject: [PATCH] fixed the torch audio detaching issue --- src/diart/sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diart/sources.py b/src/diart/sources.py index 82051b2e..c55c1da7 100644 --- a/src/diart/sources.py +++ b/src/diart/sources.py @@ -297,7 +297,7 @@ def read(self): if self.is_closed: break # shape (samples, channels) to (1, samples) - chunk = np.mean(item[0].numpy(), axis=1, keepdims=True).T + chunk = np.mean(item[0].detach().numpy(), axis=1, keepdims=True).T self.stream.on_next(chunk) except BaseException as e: self.stream.on_error(e)