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

Function build_decoder_streaming

src/models/vibevoice/tokenizer_audio.cpp:840–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840core::TensorValue build_decoder_streaming(
841 core::ModuleBuildContext & ctx,
842 const core::TensorValue & input,
843 const VibeVoiceTokenizerDecoderWeights & weights,
844 const VibeVoiceTokenizerConfig & config,
845 core::ConstantTensorCache & constants,
846 VibeVoiceStreamingBuildState & state) {
847 if (weights.stages.size() != weights.upsample_layers.size() + 1) {
848 throw std::runtime_error("VibeVoice streaming tokenizer decoder layer/stage count mismatch");
849 }
850 auto hidden = input;
851 for (size_t stage = 0; stage < weights.stages.size(); ++stage) {
852 if (stage == 0) {
853 hidden = sconv1d_streaming(ctx, hidden, weights.stem, 1, state);
854 } else {
855 hidden = sconv_transpose1d_streaming(ctx, hidden, weights.upsample_layers[stage - 1], config.decoder_ratios[stage - 1], state);
856 }
857 for (const auto & block : weights.stages[stage]) {
858 hidden = tokenizer_block_streaming(ctx, hidden, block, constants, state, config.layernorm_eps);
859 }
860 }
861 if (weights.norm.has_value()) {
862 hidden = channel_rms_norm(ctx, hidden, *weights.norm, constants, config.layernorm_eps);
863 }
864 return sconv1d_streaming(ctx, hidden, weights.head, 1, state);
865}
866
867} // namespace
868

Callers 1

Calls 5

sconv1d_streamingFunction · 0.85
channel_rms_normFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected