diff --git a/src-python/config.py b/src-python/config.py index a7a8e747..52fa5f07 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -923,8 +923,8 @@ class Config: self._TEXTBOX_UI_SCALING_RANGE = (40, 200) self._MESSAGE_BOX_RATIO_RANGE = (1, 99) self._SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_DICT = { - "Small": False, - "Large": False, + "small": False, + "large": False, } self._SELECTABLE_WHISPER_WEIGHT_TYPE_DICT = { @@ -1071,7 +1071,7 @@ class Config: self._USE_EXCLUDE_WORDS = True 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" + self._CTRANSLATE2_WEIGHT_TYPE = "small" self._WHISPER_WEIGHT_TYPE = "base" self._SEND_MESSAGE_FORMAT = "[message]" self._SEND_MESSAGE_FORMAT_WITH_T = "[message]([translation])" diff --git a/src-python/models/transcription/transcription_whisper.py b/src-python/models/transcription/transcription_whisper.py index d21df91a..049af84a 100644 --- a/src-python/models/transcription/transcription_whisper.py +++ b/src-python/models/transcription/transcription_whisper.py @@ -70,7 +70,7 @@ def downloadWhisperWeight(root, weight_type, callback=None, end_callback=None): for filename in _FILENAMES: file_path = os_path.join(path, filename) url = huggingface_hub.hf_hub_url(_MODELS[weight_type], filename) - downloadFile(url, file_path, func=callback) + downloadFile(url, file_path, func=callback if filename == "model.bin" else None) if isinstance(end_callback, Callable): end_callback() diff --git a/src-python/models/translation/translation_utils.py b/src-python/models/translation/translation_utils.py index dbe06e76..f6312884 100644 --- a/src-python/models/translation/translation_utils.py +++ b/src-python/models/translation/translation_utils.py @@ -8,7 +8,7 @@ import hashlib from utils import printLog ctranslate2_weights = { - "Small": { # M2M-100 418M-parameter model + "small": { # M2M-100 418M-parameter model "url": "https://github.com/misyaguziya/VRCT-weights/releases/download/v1.0/m2m100_418m.zip", "directory_name": "m2m100_418m", "tokenizer": "facebook/m2m100_418M", @@ -18,7 +18,7 @@ ctranslate2_weights = { "shared_vocabulary.txt": "bd440aa21b8ca3453fc792a0018a1f3fe68b3464aadddd4d16a4b72f73c86d8c", } }, - "Large": { # M2M-100 1.2B-parameter model + "large": { # M2M-100 1.2B-parameter model "url": "https://github.com/misyaguziya/VRCT-weights/releases/download/v1.0/m2m100_12b.zip", "directory_name": "m2m100_12b", "tokenizer": "facebook/m2m100_1.2b", @@ -39,7 +39,7 @@ def calculate_file_hash(file_path, block_size=65536): return hash_object.hexdigest() -def checkCTranslate2Weight(root, weight_type="Small"): +def checkCTranslate2Weight(root, weight_type="small"): weight_directory_name = ctranslate2_weights[weight_type]["directory_name"] hash_data = ctranslate2_weights[weight_type]["hash"] files = [ @@ -61,7 +61,7 @@ def checkCTranslate2Weight(root, weight_type="Small"): already_downloaded = True return already_downloaded -def downloadCTranslate2Weight(root, weight_type="Small", callback=None, end_callback=None): +def downloadCTranslate2Weight(root, weight_type="small", callback=None, end_callback=None): url = ctranslate2_weights[weight_type]["url"] filename = "weight.zip" path = os_path.join(root, "weights", "ctranslate2") diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index baddba4c..a3deffcd 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -512,7 +512,7 @@ if __name__ == "__main__": case "/set/data/ui_language": data = "ja" case "/set/data/ctranslate2_weight_type": - data = "Small" + data = "small" case "/set/data/deepl_auth_key": data = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:fx" case "/set/data/selected_mic_host":