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

Function tokenizer_block_streaming

src/models/vibevoice/tokenizer_audio.cpp:742–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740}
741
742core::TensorValue tokenizer_block_streaming(
743 core::ModuleBuildContext & ctx,
744 const core::TensorValue & input,
745 const VibeVoiceTokenizerBlockWeights & weights,
746 core::ConstantTensorCache & constants,
747 VibeVoiceStreamingBuildState & state,
748 float eps) {
749 auto residual = input;
750 auto hidden = channel_rms_norm(ctx, input, weights.norm, constants, eps);
751 hidden = sconv_depthwise1d_streaming(ctx, hidden, weights.mixer, 1, state);
752 hidden = scale_channels(ctx, hidden, weights.gamma, constants);
753 hidden = modules::AddModule{}.build(ctx, residual, hidden);
754
755 residual = hidden;
756 hidden = channel_rms_norm(ctx, hidden, weights.ffn_norm, constants, eps);
757 hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden);
758 hidden = linear(ctx, hidden, weights.ffn_linear1);
759 hidden = modules::GeluModule({modules::GeluApproximation::ExactErf}).build(ctx, hidden);
760 hidden = linear(ctx, hidden, weights.ffn_linear2);
761 hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden);
762 hidden = scale_channels(ctx, hidden, weights.ffn_gamma, constants);
763 return modules::AddModule{}.build(ctx, residual, hidden);
764}
765
766core::TensorValue build_encoder(
767 core::ModuleBuildContext & ctx,

Callers 2

build_encoder_streamingFunction · 0.85
build_decoder_streamingFunction · 0.85

Calls 7

channel_rms_normFunction · 0.85
scale_channelsFunction · 0.85
TransposeModuleClass · 0.85
GeluModuleClass · 0.85
linearFunction · 0.70
buildMethod · 0.45

Tested by

no test coverage detected