whisper: add whisper_vad_set_context to set vad_context in the state#3617
Open
xlmod wants to merge 1 commit intoggml-org:masterfrom
Open
whisper: add whisper_vad_set_context to set vad_context in the state#3617xlmod wants to merge 1 commit intoggml-org:masterfrom
xlmod wants to merge 1 commit intoggml-org:masterfrom
Conversation
ggerganov
reviewed
Jan 30, 2026
include/whisper.h
Outdated
Comment on lines
+724
to
+725
| WHISPER_API void whisper_vad_set_context_to_state(struct whisper_state * state, struct whisper_vad_context * vctx); | ||
| WHISPER_API void whisper_vad_set_context (struct whisper_context * ctx, struct whisper_vad_context * vctx); |
Member
There was a problem hiding this comment.
Rename to:
Suggested change
| WHISPER_API void whisper_vad_set_context_to_state(struct whisper_state * state, struct whisper_vad_context * vctx); | |
| WHISPER_API void whisper_vad_set_context (struct whisper_context * ctx, struct whisper_vad_context * vctx); | |
| WHISPER_API void whisper_state_set_vad(struct whisper_state * state, struct whisper_vad_context * vctx); | |
| WHISPER_API void whisper_set_vad (struct whisper_context * ctx, struct whisper_vad_context * vctx); |
src/whisper.cpp
Outdated
| int32_t exp_n_audio_ctx = 0; // 0 - use default | ||
|
|
||
| whisper_vad_context * vad_context = nullptr; | ||
| bool external_vad = false; |
Member
There was a problem hiding this comment.
Suggested change
| bool external_vad = false; | |
| bool vad_external = false; |
58e0e62 to
a49ab9a
Compare
* whisper_vad_set_context set the vad_context of the current state and set external_vad to true. * whisper_vad_set_context_to_state set the vad_context of any state and set external_vad to true. If a vad_context is set and external_vad is set to false then the existing vad_context is set. Co-authored-by: Thomas Guillem <thomas@gllm.fr>
a49ab9a to
6cb1d73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the ability to save a VAD context inside a state to prevent loading the VAD model multiple times when VAD is already used outside
whisper_full, or when you want to load it with something other than themodel_path.