]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
vad : store VAD context in whisper_state (#3156)
authorDaniel Bevenius <redacted>
Fri, 16 May 2025 05:53:26 +0000 (07:53 +0200)
committerGitHub <redacted>
Fri, 16 May 2025 05:53:26 +0000 (07:53 +0200)
commitbae5d074c7b050855f904059b10f69e44e712574
tree6da79ee10d1c501fc4d4b74a85364b130fc0a2d6
parent20a20decd94badfd519a07ea91f0bba8b8fc4dea
vad : store VAD context in whisper_state (#3156)

* vad : store VAD context in whisper_state

This commit stores the VAD context in the whisper_state structure,
allowing for better management and reuse of the VAD context across
multiple calls to the whisper_vad function.

The motivation for this change is that when updating the stream example
I noticed that the VAD context was being re-initialized every time the
whisper_vad function was called. This involved loading the VAD model
which is expensive and unnecessary if the context can be reused.

Storing this in the whisper_state seems follow the pattern simliar to
how whisper_coreml_context and whisper_openvion_context are stored.

* vad : free vad_context in whisper_free_state
src/whisper.cpp