diff --git a/buzz/model_loader.py b/buzz/model_loader.py index b8b8b2031..70aba7874 100644 --- a/buzz/model_loader.py +++ b/buzz/model_loader.py @@ -249,6 +249,7 @@ def get_local_model_path(self) -> Optional[str]: "large-v1": "7d99f41a10525d0206bddadd86760181fa920438b6b33237e3118ff6c83bb53d", "large-v2": "9a423fe4d40c82774b6af34115b8b935f34152246eb19e80e376071d3f999487", "large-v3": "64d182b440b98d5203c4f9bd541544d84c605196c4f7b845dfa11fb23594d1e2", + "large-v3-turbo": "1fc70f774d38eb169993ac391eea357ef47c88757ef72ee5943879b7e8e2bc69", "custom": None, } @@ -383,12 +384,6 @@ def download_faster_whisper_model( size = model.whisper_model_size.to_faster_whisper_model_size() custom_repo_id = model.hugging_face_model_id - if size != WhisperModelSize.CUSTOM and size not in faster_whisper.utils._MODELS: - raise ValueError( - "Invalid model size '%s', expected one of: %s" - % (size, ", ".join(faster_whisper.utils._MODELS)) - ) - if size == WhisperModelSize.CUSTOM and custom_repo_id == "": raise ValueError("Custom model id is not provided") @@ -396,6 +391,11 @@ def download_faster_whisper_model( repo_id = custom_repo_id elif size == WhisperModelSize.LARGEV3: repo_id = "Systran/faster-whisper-large-v3" + # Maybe switch to 'mobiuslabsgmbh/faster-whisper-large-v3-turbo', seems to be used in + # faster-whisper code https://github.com/SYSTRAN/faster-whisper/blob/master/faster_whisper/utils.py#L29 + # If so changes needed also in whisper_file_transcriber.py + elif size == WhisperModelSize.LARGEV3TURBO: + repo_id = "deepdml/faster-whisper-large-v3-turbo-ct2" else: repo_id = "guillaumekln/faster-whisper-%s" % size diff --git a/buzz/transcriber/whisper_file_transcriber.py b/buzz/transcriber/whisper_file_transcriber.py index 88d7b1a71..7deb6349a 100644 --- a/buzz/transcriber/whisper_file_transcriber.py +++ b/buzz/transcriber/whisper_file_transcriber.py @@ -139,6 +139,8 @@ def transcribe_hugging_face(cls, task: FileTranscriptionTask) -> List[Segment]: def transcribe_faster_whisper(cls, task: FileTranscriptionTask) -> List[Segment]: if task.transcription_options.model.whisper_model_size == WhisperModelSize.CUSTOM: model_size_or_path = task.transcription_options.model.hugging_face_model_id + elif task.transcription_options.model.whisper_model_size == WhisperModelSize.LARGEV3TURBO: + model_size_or_path = "deepdml/faster-whisper-large-v3-turbo-ct2" else: model_size_or_path = task.transcription_options.model.whisper_model_size.to_faster_whisper_model_size() diff --git a/buzz/widgets/preferences_dialog/models_preferences_widget.py b/buzz/widgets/preferences_dialog/models_preferences_widget.py index 26ab5f83a..5f569f541 100644 --- a/buzz/widgets/preferences_dialog/models_preferences_widget.py +++ b/buzz/widgets/preferences_dialog/models_preferences_widget.py @@ -181,11 +181,6 @@ def reset(self): model_size == WhisperModelSize.CUSTOM): continue - # Skip turbo model for Faste Whisper and Whisper.cpp - if (self.model.model_type in {ModelType.FASTER_WHISPER, ModelType.WHISPER_CPP} and - model_size == WhisperModelSize.LARGEV3TURBO): - continue - model = TranscriptionModel( model_type=self.model.model_type, whisper_model_size=WhisperModelSize(model_size), diff --git a/buzz/widgets/transcriber/transcription_options_group_box.py b/buzz/widgets/transcriber/transcription_options_group_box.py index fb74ff3f8..a02f45c53 100644 --- a/buzz/widgets/transcriber/transcription_options_group_box.py +++ b/buzz/widgets/transcriber/transcription_options_group_box.py @@ -52,7 +52,7 @@ def __init__( self.whisper_model_size_combo_box = QComboBox(self) self.whisper_model_size_combo_box.addItems( - [size.value.title() for size in WhisperModelSize if size not in {WhisperModelSize.CUSTOM, WhisperModelSize.LARGEV3TURBO}] + [size.value.title() for size in WhisperModelSize if size not in {WhisperModelSize.CUSTOM}] ) self.whisper_model_size_combo_box.currentTextChanged.connect( self.on_whisper_model_size_changed @@ -142,24 +142,12 @@ def reset_visible_rows(self): and whisper_model_size == WhisperModelSize.CUSTOM), ) - # Add turbo model size for whisper - if model_type == ModelType.WHISPER: - if self.whisper_model_size_combo_box.findText(WhisperModelSize.LARGEV3TURBO.value.title()) == -1: - self.whisper_model_size_combo_box.addItem(WhisperModelSize.LARGEV3TURBO.value.title()) - # Remove custom model size for whisper custom_model_index = (self.whisper_model_size_combo_box .findText(WhisperModelSize.CUSTOM.value.title())) if model_type == ModelType.WHISPER and custom_model_index != -1: self.whisper_model_size_combo_box.removeItem(custom_model_index) - # Remove turbo model size for whisper_cpp and faster_whisper - turbo_model_index = (self.whisper_model_size_combo_box - .findText(WhisperModelSize.LARGEV3TURBO.value.title())) - if ((model_type == ModelType.WHISPER_CPP or model_type == ModelType.FASTER_WHISPER) - and turbo_model_index != -1): - self.whisper_model_size_combo_box.removeItem(turbo_model_index) - # Add custom model size for whisper_cpp custom_model_index = (self.whisper_model_size_combo_box .findText(WhisperModelSize.CUSTOM.value.title()))