argmaxinc / WhisperKit

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

Can a local model be used without requesting the Hugging Face API? #126

Closed jiangdi0924 closed 5 months ago

jiangdi0924 commented 5 months ago

Is there a way to use a local model without requesting the Hugging Face API? For some reason, the user cannot access the Huggingface API.

`

let whisperKit = try await WhisperKit( verbose: true, logLevel: .debug, prewarm: false, load: false, download: false )

    let path = Path.home/"Documents/openai_whisper-small/"

`

Error Info

Task <DF53BEFE-3EB6-44A7-BA0C-74E426592D16>.<2> finished with error [18,446,744,073,709,550,416] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://huggingface.co/api/models/openai/whisper-small, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DF53BEFE-3EB6-44A7-BA0C-74E426592D16>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <DF53BEFE-3EB6-44A7-BA0C-74E426592D16>.<2>" ), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://huggingface.co/api/models/openai/whisper-small, NSUnderlyingError=0x600000e43600 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9816, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9816, _NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, proxy}}, _kCFStreamErrorCodeKey=-9816}

jiangdi0924 commented 5 months ago

The issue might be caused by calling the HubApi. Currently, the logic for obtaining the Tokenizer for the local model seems to involve remote retrieval. image

atiorh commented 5 months ago

Hi @jiangdi0924 , please check out #81. This should be fixed soon.

atiorh commented 5 months ago

This is fixed in the 0.6.1 release (c20943d). Please reopen the issue if the problem persists.