Repository navigation
feat: VAD-only GGUF files (head, front end, subsampler) and a slicer - #87
Merged
Merged
Conversation
scripts/slice_vad_gguf.py copies from an Ultra or Redux GGUF only what the VAD path reads: the mel filterbank and window, the subsampler, the vad_head tensors and the encoder, preprocessor and vad config keys. It does not requantize, sets parakeet.arch to "vad" and records the parent name, file, size, architecture and SHA-256. The marker is needed because the loader expects a vocabulary and decoder. ModelLoader accepts arch "vad" without a vocabulary. The new Model::load_vad_only serves the slice, and parakeet-cli vad and the C-API VAD calls use it through a separate context slot. Model::load and DiarizationModel::load refuse the slice with a log message, and every other C-API call reports that the context holds a VAD-only model. Existing files load as before. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
Add the two published slice files, redux-vad.gguf and ultra-vad-q8_0.gguf, with sizes and SHA-256 to docs/vad.md, the README and models/MANIFEST.md. Note that they are cut out of Moondream's models (CC-BY-4.0) and cannot transcribe. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
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.
What and why
Ultra and Redux have a built-in VAD head, but using it meant loading the whole model, 213 MB to 1.4 GB. The head reads only the log-mel front end, the subsampler and itself. This PR adds a script that cuts those parts out into a 6 to 10 MB GGUF, and loaders that run VAD from it.
How
scripts/slice_vad_gguf.pycopies 20 tensors byte for byte from an Ultra or Redux GGUF, plus the encoder, preprocessor andparakeet.vad.*keys. It does not requantize. It records the parent (name, file, size, architecture, SHA-256) as provenance metadata.parakeet.arch=vad. A normal file has a vocabulary and a decoder, and the slice has neither, so the loader needs the marker.ModelLoader::loadaccepts the marker without a vocabulary. NewModel::load_vad_onlyserves it.parakeet-cli vad(viagguf_is_vad_only) and theparakeet_capi_vad_*functions use it through a separate context slot.Model::load,DiarizationModel::load, and the other C-API entry points ("context holds a VAD-only model"). Files that are not slices load as before.Results
Compared with the parent model on three clips and four slices (Ultra Q8_0, Ultra F16, Redux packed, Redux dequantized F16):
I also ran
parakeet-cli vadon the two published files below and compared with the full parent output ontwo_speakers.wav: identical.Tests
tests/test_vad_only.cpp(labelmodel; needsPARAKEET_TEST_VAD_ONLY_GGUFandPARAKEET_TEST_GGUF_ULTRA): the slice gives the parent's VAD output, and the slice is refused by the other calls.ctest -LE model: 35 of 35 pass (5 skipped for missing fixtures). With the model GGUFs set, everything passes excepttest_relpos_attention_local_chunkedandtest_capi_timestamps, which fail without this change too.Limits
Published files
Both are on https://huggingface.co/mudler/parakeet-cpp-gguf, CC-BY-4.0. They are cut out of Moondream's models, not trained here: credit Moondream and NVIDIA. docs/vad.md, the README and models/MANIFEST.md link them with sizes and checksums.
redux-vad.gguf588e1d6e2ee5b6cdfd9ec5ea98dc0993d5bea498d9cc4ec8d6077041eef8a34fultra-vad-q8_0.gguf8b891a4435e97438104ca07c72530d0c5fe62b986baee48b2dd4e1500c1d4758Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
🤖 Generated with Claude Code