| 838 | } |
| 839 | |
| 840 | core::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 |
no test coverage detected