From cc41a9ee88a8dca027a34c37cc1c67f8198958b9 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 01 三月 2024 14:58:36 +0800
Subject: [PATCH] whisper
---
funasr/frontends/whisper_frontend.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/funasr/frontends/whisper_frontend.py b/funasr/frontends/whisper_frontend.py
index 752fd20..9290a25 100644
--- a/funasr/frontends/whisper_frontend.py
+++ b/funasr/frontends/whisper_frontend.py
@@ -17,8 +17,9 @@
def __init__(
self,
fs: int = 16000,
- whisper_model: str = "large-v3",
+ whisper_model: str = None,
do_pad_trim: bool = True,
+ n_mels: int = 80,
):
super().__init__()
assert fs == 16000
@@ -30,17 +31,16 @@
self.pad_samples = N_SAMPLES
self.frame_shift = self.hop_length
self.lfr_n = 1
+ self.n_mels = n_mels
if whisper_model == "large-v3" or whisper_model == "large":
self.n_mels = 128
- else:
- self.n_mels = 80
self.mel_filters = whisper.audio.mel_filters
self.do_pad_trim = do_pad_trim
if do_pad_trim:
self.pad_or_trim = whisper.pad_or_trim
- assert whisper_model in whisper.available_models()
+ # assert whisper_model in whisper.available_models()
def output_size(self) -> int:
return self.n_mels
--
Gitblit v1.9.1