Skip to content

Commit d16d5d8

Browse files
committed
Fix bulding
1 parent 66991a3 commit d16d5d8

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

cmd/subtitleswindow/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.1
44

55
replace 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

99
replace github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5 => github.com/KarpelesLab/static-portaudio v0.6.190600
1010

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ github.com/xaionaro-go/typing v0.0.0-20221123235249-2229101d38ba h1:wuSIPuGbTeFk
377377
github.com/xaionaro-go/typing v0.0.0-20221123235249-2229101d38ba/go.mod h1:6wJwFezlmN6Lk38K3eNzGUZ4MmHHzgTAIepvldyiprY=
378378
github.com/xaionaro-go/unsafetools v0.0.0-20241024014258-a46e1ce3763e h1:FV+/FVPYOncsNNqtlMvqRDrsQznArX0lO0PkFifixDs=
379379
github.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=
382382
github.com/xaionaro-go/xcontext v0.0.0-20250111150717-e70e1f5b299c h1://sE/WLpO7wpcVsp1FfTNAG9JmL60KfXiogNVKYivTA=
383383
github.com/xaionaro-go/xcontext v0.0.0-20250111150717-e70e1f5b299c/go.mod h1:MGRT1+2m2adVRc4aAn0RVGysjsSRKN9VCyBJLHvQd4k=
384384
github.com/xaionaro-go/xsync v0.0.0-20250113213958-aedf9c8786f5 h1:l18KTPxJCTppjRNVRtE5PcKCqFBSzVPcwAw2x0vxAdo=

pkg/speech/speechtotext/implementations/whisper/speech_to_text.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)