游雁
2024-06-24 1596f6f414f6f41da66506debb1dff19fffeb3ec
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: