From 134ef373afe1327e81a08d7b12b9fef37cf25ecb Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:58:21 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20[Remove]=20Model=20:=20?= =?UTF-8?q?Whisper=E3=81=AE=E4=B8=8D=E8=A6=81=E3=81=AA=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/config.py | 12 --------- src-python/webui_controller.py | 46 ++-------------------------------- src-python/webui_mainloop.py | 4 --- 3 files changed, 2 insertions(+), 60 deletions(-) diff --git a/src-python/config.py b/src-python/config.py index ee02eb05..9045a690 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -677,17 +677,6 @@ class Config: self._USE_TRANSLATION_FEATURE = value self.saveConfig(inspect.currentframe().f_code.co_name, value) - @property - @json_serializable('USE_WHISPER_FEATURE') - def USE_WHISPER_FEATURE(self): - return self._USE_WHISPER_FEATURE - - @USE_WHISPER_FEATURE.setter - def USE_WHISPER_FEATURE(self, value): - if isinstance(value, bool): - self._USE_WHISPER_FEATURE = value - self.saveConfig(inspect.currentframe().f_code.co_name, value) - @property @json_serializable('SELECTED_TRANSLATION_COMPUTE_DEVICE') def SELECTED_TRANSLATION_COMPUTE_DEVICE(self): @@ -1083,7 +1072,6 @@ class Config: } self._USE_EXCLUDE_WORDS = True self._USE_TRANSLATION_FEATURE = True - self._USE_WHISPER_FEATURE = False self._SELECTED_TRANSLATION_COMPUTE_DEVICE = {"device": "cpu", "device_index": 0, "device_name":"cpu"} self._SELECTED_TRANSCRIPTION_COMPUTE_DEVICE = {"device": "cpu", "device_index": 0, "device_name":"cpu"} self._CTRANSLATE2_WEIGHT_TYPE = "Small" diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 1832b42b..d20790b2 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -1092,35 +1092,6 @@ class Controller: config.USE_TRANSLATION_FEATURE = False return {"status":200, "result": config.USE_TRANSLATION_FEATURE} - @staticmethod - def getUseWhisperFeature(*args, **kwargs) -> dict: - return {"status":200, "result":config.USE_WHISPER_FEATURE} - - @staticmethod - def setEnableUseWhisperFeature(*args, **kwargs) -> dict: - config.USE_WHISPER_FEATURE = True - if model.checkTranscriptionWhisperModelWeight() is True: - config.SELECTED_TRANSCRIPTION_ENGINE = "Whisper" - else: - config.SELECTED_TRANSCRIPTION_ENGINE = "Google" - return {"status":200, - "result":{ - "feature":config.USE_WHISPER_FEATURE, - "transcription_engine":config.SELECTED_TRANSCRIPTION_ENGINE, - }, - } - - @staticmethod - def setDisableUseWhisperFeature(*args, **kwargs) -> dict: - config.USE_WHISPER_FEATURE = False - config.SELECTED_TRANSCRIPTION_ENGINE = "Google" - return {"status":200, - "result":{ - "feature":config.USE_WHISPER_FEATURE, - "transcription_engine":config.SELECTED_TRANSCRIPTION_ENGINE, - }, - } - @staticmethod def getCtranslate2WeightType(*args, **kwargs) -> dict: return {"status":200, "result":config.CTRANSLATE2_WEIGHT_TYPE} @@ -1650,22 +1621,9 @@ class Controller: printLog("Set Translation Engine") self.updateTranslationEngineAndEngineList() - # check Downloaded CTranslate2 Model Weight - printLog("Check Downloaded CTranslate2 Model Weight") - if config.USE_TRANSLATION_FEATURE is True and model.checkCTranslatorCTranslate2ModelWeight() is False: - self.startThreadingDownloadCtranslate2Weight(self.downloadCTranslate2ProgressBar) - # set Transcription Engine - printLog("Set Transcription Engine") - if config.USE_WHISPER_FEATURE is True: - config.SELECTED_TRANSCRIPTION_ENGINE = "Whisper" - else: - config.SELECTED_TRANSCRIPTION_ENGINE = "Google" - - # check Downloaded Whisper Model Weight - printLog("Check Downloaded Whisper Model Weight") - if config.USE_WHISPER_FEATURE is True and model.checkTranscriptionWhisperModelWeight() is False: - self.startThreadingDownloadWhisperWeight(self.downloadWhisperProgressBar) + # printLog("Set Transcription Engine") + # self.updateTranscriptionEngineAndEngineList() # set word filter printLog("Set Word Filter") diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 68f6f3c1..54671c62 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -246,10 +246,6 @@ mapping = { "/get/data/whisper_weight_type": {"status": True, "variable":controller.getWhisperWeightType}, "/set/data/whisper_weight_type": {"status": True, "variable":controller.setWhisperWeightType}, - "/get/data/use_whisper_feature": {"status": True, "variable":controller.getUseWhisperFeature}, - "/set/enable/use_whisper_feature": {"status": True, "variable":controller.setEnableUseWhisperFeature}, - "/set/disable/use_whisper_feature": {"status": True, "variable":controller.setDisableUseWhisperFeature}, - "/run/download_whisper_weight": {"status": True, "variable":controller.downloadWhisperWeight}, # VR