| 740 | } |
| 741 | |
| 742 | core::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 | |
| 766 | core::TensorValue build_encoder( |
| 767 | core::ModuleBuildContext & ctx, |
no test coverage detected