SYSTRAN / faster-whisper

Faster Whisper transcription with CTranslate2
MIT License
12.51k stars 1.05k forks source link

Unable to open file 'model.bin' in model 'models\base' #945

Closed cup113 closed 3 months ago

cup113 commented 3 months ago

Code:

model = WhisperModel(str(Path(argv[0]).parent / "models" / "base"), files={
    "tokenizer.json": open_json("./models/base/tokenizer.json"),
    "preprocesser_config.json": open_json("./models/base/config.json"),
})

Error:

  File "...\Lib\site-packages\faster_whisper\transcribe.py", line 145, in __init__
    self.model = ctranslate2.models.Whisper(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Unable to open file 'model.bin' in model 'models\base'

Directory structure: image

Versions:

Package            Version
------------------ ---------
ctranslate2        4.3.1
faster-whisper     1.0.3

All files under 'models/base' are directly downloaded from https://huggingface.co/guillaumekln/faster-whisper-base/tree/main.

(No non-ASCII character involved in path)

cup113 commented 3 months ago

Sorry. Using local_files_only=True instead of assigning files parameters fixed the problem.

model_path = Path(argv[0]).parent / "models" / "base"
self.model = WhisperModel(str(model_path), local_files_only=True)