Skip to content

Commit

Permalink
update tweaks around v3 models (which include turbo models)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronymous committed Nov 25, 2024
1 parent 3649d91 commit de35045
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def __init__(
**model_kwargs,
)

is_v3 = "large-v3" in model_size_or_path
is_v3 = "large-v3" in model_size_or_path or "turbo" in model_size_or_path
self.is_v3 = is_v3

tokenizer_file = os.path.join(model_path, "tokenizer.json")
Expand All @@ -662,10 +662,10 @@ def __init__(

self.feat_kwargs = self._get_feature_kwargs(model_path, preprocessor_bytes)
self.feature_extractor = FeatureExtractor(**self.feat_kwargs)
if is_v3:
# Number of mel features changed
self.feature_extractor.mel_filters = self.feature_extractor.get_mel_filters(
self.feature_extractor.sampling_rate, self.feature_extractor.n_fft, n_mels=128)
# if is_v3:
# # Number of mel features changed
# self.feature_extractor.mel_filters = self.feature_extractor.get_mel_filters(
# self.feature_extractor.sampling_rate, self.feature_extractor.n_fft, n_mels=128)
self.input_stride = 2
self.num_samples_per_token = (
self.feature_extractor.hop_length * self.input_stride
Expand Down

0 comments on commit de35045

Please sign in to comment.