MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / build_decoder

Function build_decoder

src/models/vibevoice/tokenizer_audio.cpp:814–838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812}
813
814core::TensorValue build_decoder(
815 core::ModuleBuildContext & ctx,
816 const core::TensorValue & input,
817 const VibeVoiceTokenizerDecoderWeights & weights,
818 const VibeVoiceTokenizerConfig & config,
819 core::ConstantTensorCache & constants) {
820 if (weights.stages.size() != weights.upsample_layers.size() + 1) {
821 throw std::runtime_error("VibeVoice tokenizer decoder layer/stage count mismatch");
822 }
823 auto hidden = input;
824 for (size_t stage = 0; stage < weights.stages.size(); ++stage) {
825 if (stage == 0) {
826 hidden = sconv1d(ctx, hidden, weights.stem, 1);
827 } else {
828 hidden = sconv_transpose1d(ctx, hidden, weights.upsample_layers[stage - 1], config.decoder_ratios[stage - 1]);
829 }
830 for (const auto & block : weights.stages[stage]) {
831 hidden = tokenizer_block(ctx, hidden, block, constants, config.layernorm_eps);
832 }
833 }
834 if (weights.norm.has_value()) {
835 hidden = channel_rms_norm(ctx, hidden, *weights.norm, constants, config.layernorm_eps);
836 }
837 return sconv1d(ctx, hidden, weights.head, 1);
838}
839
840core::TensorValue build_decoder_streaming(
841 core::ModuleBuildContext & ctx,

Callers 2

ensure_decoder_graphMethod · 0.85

Calls 5

sconv1dFunction · 0.85
sconv_transpose1dFunction · 0.85
tokenizer_blockFunction · 0.85
channel_rms_normFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected