mlx-examples icon indicating copy to clipboard operation
mlx-examples copied to clipboard

whisper: No such file or directory: 'mlx_models/config.json'

Open sivanola opened this issue 1 year ago • 5 comments

I'm trying to run whisper, but I'm getting No such file or directory: 'mlx_models/config.json' I converted pytorch large model, the conversion creates this structure: mlx_models/large/config.json So, when I try to do whisper.transcribe(speech_file, model="large"), it doesn't recognize the folder and looks for config.json in mlx_models instead of in mlx_models/large/...

sivanola avatar Jan 10 '24 09:01 sivanola

Maybe you are using an outdated whisper? The transcribe function takes an path_or_hf_repo as the second argument which you should set to mlx_models/large if that's where you stored the model.

awni avatar Jan 10 '24 14:01 awni

I think the README for this example needs a little work, I will update it.

awni avatar Jan 10 '24 14:01 awni

Oh, I see. I tried it and it works now. I tried so many versions of model_path, model..., but missed the obvious one. It works with text = whisper.transcribe(speech_file, path_or_hf_repo="mlx_models/large")

sivanola avatar Jan 10 '24 15:01 sivanola

For future reference help(whisper.transcribe) will tell you about the arguments it can accept 😄

awni avatar Jan 10 '24 15:01 awni

I checked it twice but somehow misread path_or_hf_repo. I saw path_of_hf_repo. And then I accidentally opened this issue. It's just a brain fog day :dizzy_face:

sivanola avatar Jan 10 '24 16:01 sivanola