From 7cb8c473d4adb8dc1377fa13eb8f14a29bee2afe Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Thu, 1 Feb 2024 13:41:31 +0900 Subject: [PATCH] =?UTF-8?q?[WIP/TEST]=20Model=20:=20large=E3=83=A2?= =?UTF-8?q?=E3=83=87=E3=83=AB=E3=82=92=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?/=20en=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/transcription/transcription_whisper.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/models/transcription/transcription_whisper.py b/models/transcription/transcription_whisper.py index dc606cb7..67ad61f0 100644 --- a/models/transcription/transcription_whisper.py +++ b/models/transcription/transcription_whisper.py @@ -8,18 +8,13 @@ logger = logging.getLogger('faster_whisper') logger.setLevel(logging.CRITICAL) _MODELS = { - "tiny.en": "Systran/faster-whisper-tiny.en", "tiny": "Systran/faster-whisper-tiny", - "base.en": "Systran/faster-whisper-base.en", "base": "Systran/faster-whisper-base", - "small.en": "Systran/faster-whisper-small.en", "small": "Systran/faster-whisper-small", - "medium.en": "Systran/faster-whisper-medium.en", "medium": "Systran/faster-whisper-medium", "large-v1": "Systran/faster-whisper-large-v1", "large-v2": "Systran/faster-whisper-large-v2", "large-v3": "Systran/faster-whisper-large-v3", - "large": "Systran/faster-whisper-large-v3", } _FILENAMES = [ @@ -28,6 +23,7 @@ _FILENAMES = [ "model.bin", "tokenizer.json", "vocabulary.txt", + "vocabulary.json", ] def downloadFile(url, path, func=None): @@ -67,6 +63,7 @@ def downloadWhisperWeight(root, weight_type, callbackFunc): path = os_path.join(root, "weight", "whisper", weight_type) os_makedirs(path, exist_ok=True) if checkWhisperWeight(path) is True: + print("weight_type:", weight_type, checkWhisperWeight(path)) return for filename in _FILENAMES: @@ -75,6 +72,8 @@ def downloadWhisperWeight(root, weight_type, callbackFunc): url = huggingface_hub.hf_hub_url(_MODELS[weight_type], filename) downloadFile(url, file_path, func=callbackFunc) + print("weight_type:", weight_type, checkWhisperWeight(path)) + def getWhisperModel(root, weight_type): path = os_path.join(root, "weight", "whisper", weight_type) return WhisperModel( @@ -90,9 +89,12 @@ def getWhisperModel(root, weight_type): if __name__ == "__main__": def callback(value): print(value) + pass downloadWhisperWeight("./", "tiny", callback) downloadWhisperWeight("./", "base", callback) downloadWhisperWeight("./", "small", callback) downloadWhisperWeight("./", "medium", callback) - downloadWhisperWeight("./", "large", callback) \ No newline at end of file + downloadWhisperWeight("./", "large-v1", callback) + downloadWhisperWeight("./", "large-v2", callback) + downloadWhisperWeight("./", "large-v3", callback) \ No newline at end of file