From 964103786ae5f6b82d20e6ca12a501c696c3fd54 Mon Sep 17 00:00:00 2001 From: MKNachesa Date: Thu, 6 Apr 2023 11:48:37 +0200 Subject: [PATCH] fixed torch warning on using a list of numpy arrays Signed-off-by: MKNachesa --- nemo/collections/asr/models/label_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nemo/collections/asr/models/label_models.py b/nemo/collections/asr/models/label_models.py index d8065d4919e4..aefa8743826b 100644 --- a/nemo/collections/asr/models/label_models.py +++ b/nemo/collections/asr/models/label_models.py @@ -427,9 +427,9 @@ def infer_file(self, path2audio_file): audio = librosa.core.resample(audio, orig_sr=sr, target_sr=target_sr) audio_length = audio.shape[0] device = self.device - audio = np.array(audio) + audio = np.array([audio]) audio_signal, audio_signal_len = ( - torch.tensor([audio], device=device), + torch.tensor(audio, device=device), torch.tensor([audio_length], device=device), ) mode = self.training