From 1cdb3cc28d4d89a576cc06e5cd8eb80da1f3a3aa Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 26 四月 2024 11:27:39 +0800
Subject: [PATCH] Dev gzf exp (#1665)

---
 funasr/models/sense_voice/whisper_lib/audio.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/funasr/models/sense_voice/whisper_lib/audio.py b/funasr/models/sense_voice/whisper_lib/audio.py
index 52da32c..2f688e9 100644
--- a/funasr/models/sense_voice/whisper_lib/audio.py
+++ b/funasr/models/sense_voice/whisper_lib/audio.py
@@ -68,9 +68,7 @@
     """
     if torch.is_tensor(array):
         if array.shape[axis] > length:
-            array = array.index_select(
-                dim=axis, index=torch.arange(length, device=array.device)
-            )
+            array = array.index_select(dim=axis, index=torch.arange(length, device=array.device))
 
         if array.shape[axis] < length:
             pad_widths = [(0, 0)] * array.ndim
@@ -89,7 +87,7 @@
 
 
 @lru_cache(maxsize=None)
-def mel_filters(device, n_mels: int, filters_path: str=None) -> torch.Tensor:
+def mel_filters(device, n_mels: int, filters_path: str = None) -> torch.Tensor:
     """
     load the mel filterbank matrix for projecting STFT into a Mel spectrogram.
     Allows decoupling librosa dependency; saved using:

--
Gitblit v1.9.1