diff --git a/src-python/config.py b/src-python/config.py index 68c5a96a..e8b17bf9 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -924,7 +924,7 @@ class Config: self._SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_LIST = ctranslate2_weights.keys() self._SELECTABLE_WHISPER_WEIGHT_TYPE_LIST = whisper_models.keys() self._SELECTABLE_TRANSLATION_ENGINE_LIST = translation_lang.keys() - self._SELECTABLE_TRANSCRIPTION_ENGINE_LIST = translation_lang.keys() + self._SELECTABLE_TRANSCRIPTION_ENGINE_LIST = list(transcription_lang[list(transcription_lang.keys())[0]].values())[0].keys() self._SELECTABLE_UI_LANGUAGE_LIST = ["en", "ja", "ko", "zh-Hant", "zh-Hans"] self._COMPUTE_MODE = "cuda" if torch.cuda.is_available() else "cpu" self._SELECTABLE_COMPUTE_DEVICE_LIST = [] diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 50b3b37d..fedade0d 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -418,6 +418,7 @@ class Controller: def setSelectedTranslationComputeDevice(device:str, *args, **kwargs) -> dict: printLog("setSelectedTranslationComputeDevice", device) config.SELECTED_TRANSLATION_COMPUTE_DEVICE = device + model.changeTranslatorCTranslate2Model() return {"status":200,"result":config.SELECTED_TRANSLATION_COMPUTE_DEVICE} @staticmethod diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 7495fbce..e81e01e4 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -125,6 +125,9 @@ mapping = { "/get/data/translation_compute_device_list": {"status": True, "variable":controller.getComputeDeviceList}, "/get/data/selected_translation_compute_device": {"status": True, "variable":controller.getSelectedTranslationComputeDevice}, "/set/data/selected_translation_compute_device": {"status": True, "variable":controller.setSelectedTranslationComputeDevice}, + "/get/data/transcription_compute_device_list": {"status": True, "variable":controller.getComputeDeviceList}, + "/get/data/selected_transcription_compute_device": {"status": True, "variable":controller.getSelectedTranscriptionComputeDevice}, + "/set/data/selected_transcription_compute_device": {"status": True, "variable":controller.setSelectedTranscriptionComputeDevice}, # Translation "/get/data/selectable_ctranslate2_weight_type_dict": {"status": True, "variable":controller.getSelectableCtranslate2WeightTypeDict}, @@ -228,10 +231,6 @@ mapping = { "/set/enable/check_speaker_threshold": {"status": True, "variable":controller.setEnableCheckSpeakerThreshold}, "/set/disable/check_speaker_threshold": {"status": True, "variable":controller.setDisableCheckSpeakerThreshold}, - "/get/data/transcription_compute_device_list": {"status": True, "variable":controller.getComputeDeviceList}, - "/get/data/selected_transcription_compute_device": {"status": True, "variable":controller.getSelectedTranscriptionComputeDevice}, - "/set/data/selected_transcription_compute_device": {"status": True, "variable":controller.setSelectedTranscriptionComputeDevice}, - "/get/data/selectable_whisper_weight_type_dict": {"status": True, "variable":controller.getSelectableWhisperWeightTypeDict}, "/get/data/whisper_weight_type": {"status": True, "variable":controller.getWhisperWeightType}, "/set/data/whisper_weight_type": {"status": True, "variable":controller.setWhisperWeightType},