argmaxinc / WhisperKit

On-device Speech Recognition for Apple Silicon
https://takeargmax.com/blog/whisperkit
MIT License
3.17k stars 268 forks source link

Using locally saved models #46

Closed iSapozhnik closed 6 months ago

iSapozhnik commented 6 months ago

Hey! Thanks for making WhisperKit!

I hope I did not miss it in the documentation. But is it possible to provide a local URL to the model for the WhisperKit instead of relying on its internal mechanism to load the model? Inside my app I already have a nice UI that allows to download, suspend, and cancel download progress so would be nice if I could then feed WhisperKit with the local URL.

If there is no such functionality but you are considering adding it - I might try to help by making a PR.

Thanks.

ZachNagengast commented 6 months ago

Yep pretty simple to do, all that's needed is to provide a modelFolder when initializing the WhisperKit object and it'll use that as the path to look for the models.

let whisperkit = try await WhisperKit(modelFolder: "your/local/model/folder/")
iSapozhnik commented 6 months ago

Thanks a lot 👍🏻