feat: support separate codec GGUF via --codec-model#36
Conversation
Add --codec-model <path> CLI flag to load codec weights from a separate GGUF file instead of the main model file. This enables split model distributions where the codec and main model are packaged independently. Changes: - PipelineParams: add codec_model_path field - main.cpp: parse --codec-model argument - s2_codec.cpp: load_shared handles separate codec GGUF path with proper metadata loading and cleanup - s2_pipeline.cpp: branch codec loading when codec_model_path is set, load tensor data from separate codec file
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request adds support for loading the audio codec from a separate GGUF model file. The configuration field is wired through CLI argument parsing, fallback metadata loading is added to the codec loader, and pipeline initialization is updated to use the optional separate path and load codec tensor data accordingly. ChangesSeparate Codec Model Path
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Add
--codec-model <path>CLI flag to load codec weights from a separate GGUF file instead of the main model file.Motivation
When distributing models as split files (main model + codec in separate GGUFs), the current code only supports loading the codec from the same GGUF as the main model. This PR enables loading the codec from an independent GGUF file, which is useful for:
Changes
include/s2_pipeline.hcodec_model_pathtoPipelineParamssrc/main.cpp--codec-modelCLI argumentsrc/s2_codec.cppload_sharedhandles separate codec GGUF with proper metadata loading and cleanupsrc/s2_pipeline.cppcodec_model_pathis set; load tensor data from separate codec fileUsage
./s2 --model main-model.gguf --codec-model codec.gguf --text "Hello world"When
--codec-modelis not provided, behavior is unchanged (codec loads from the main model GGUF).Backward compatibility
Fully backward compatible — the new flag is optional and the default behavior (codec from main GGUF) is preserved.
Summary by CodeRabbit
--codec-model <path>CLI option.