File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
pkg/speech/speechtotext/implementations/whisper Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ func main() {
8383 if err != nil {
8484 panic (err )
8585 }
86+ if len (whisperModel ) == 0 {
87+ panic ("whisper model file is empty" )
88+ }
8689 }
8790
8891 audioEnc := consts .AudioEncoding ()
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ go 1.24.1
44
55replace github.com/asticode/go-astiav v0.35.1 => github.com/xaionaro-go/astiav v0.0.0-20250401003159-fe890da0a1a9
66
7- replace github.com/mutablelogic/go-whisper v0.0.22-0.20241221210700-ba095bdd5196 => github.com/xaionaro-go/whisper v0.0.0-20250113112709-f6b19475a1f1
7+ replace github.com/mutablelogic/go-whisper v0.0.22-0.20241221210700-ba095bdd5196 => github.com/xaionaro-go/whisper v0.0.0-20250406150907-3edb04869838
88
99replace github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5 => github.com/KarpelesLab/static-portaudio v0.6.190600
1010
Original file line number Diff line number Diff line change @@ -377,8 +377,8 @@ github.com/xaionaro-go/typing v0.0.0-20221123235249-2229101d38ba h1:wuSIPuGbTeFk
377377github.com/xaionaro-go/typing v0.0.0-20221123235249-2229101d38ba /go.mod h1:6wJwFezlmN6Lk38K3eNzGUZ4MmHHzgTAIepvldyiprY =
378378github.com/xaionaro-go/unsafetools v0.0.0-20241024014258-a46e1ce3763e h1:FV+/FVPYOncsNNqtlMvqRDrsQznArX0lO0PkFifixDs =
379379github.com/xaionaro-go/unsafetools v0.0.0-20241024014258-a46e1ce3763e /go.mod h1:ERewyGVM0zYnWA9nxdHPIC3xc9Yrf5CgAnBITuP3FRE =
380- github.com/xaionaro-go/whisper v0.0.0-20250113112709-f6b19475a1f1 h1:3K8qRxw1lgXR9aAAD9TP7GwWNzLSYfJED/DTzoRgW40 =
381- github.com/xaionaro-go/whisper v0.0.0-20250113112709-f6b19475a1f1 /go.mod h1:uckbdbn37jcaJ5ZdDSWtEQRVz/qWnReWxkcs6LWTlMU =
380+ github.com/xaionaro-go/whisper v0.0.0-20250406150907-3edb04869838 h1:FuaSf5FAOXrJOo4FJICPKXtLZk6ipPIfq1rKvn+hLMI =
381+ github.com/xaionaro-go/whisper v0.0.0-20250406150907-3edb04869838 /go.mod h1:uckbdbn37jcaJ5ZdDSWtEQRVz/qWnReWxkcs6LWTlMU =
382382github.com/xaionaro-go/xcontext v0.0.0-20250111150717-e70e1f5b299c h1://sE/WLpO7wpcVsp1FfTNAG9JmL60KfXiogNVKYivTA =
383383github.com/xaionaro-go/xcontext v0.0.0-20250111150717-e70e1f5b299c /go.mod h1:MGRT1+2m2adVRc4aAn0RVGysjsSRKN9VCyBJLHvQd4k =
384384github.com/xaionaro-go/xsync v0.0.0-20250113213958-aedf9c8786f5 h1:l18KTPxJCTppjRNVRtE5PcKCqFBSzVPcwAw2x0vxAdo =
Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ func New(
8888 vadThreshold float64 ,
8989 opts ... Option ,
9090) (* SpeechToText , error ) {
91+ if len (modelBytes ) == 0 {
92+ return nil , fmt .Errorf ("the model is empty" )
93+ }
94+
9195 cfg := Options (opts ).config ()
9296 params := whisper .DefaultContextParams ()
9397 if cfg .UseGPU != nil {
You can’t perform that action at this time.
0 commit comments