| 163 | } |
| 164 | |
| 165 | core::TensorValue build_swiglu( |
| 166 | core::ModuleBuildContext & ctx, |
| 167 | const core::TensorValue & input, |
| 168 | const VibeVoiceDiffusionHeadLayerWeights & weights, |
| 169 | const VibeVoiceDiffusionHeadConfig & config) { |
| 170 | const int64_t ffn = ffn_dim(config); |
| 171 | auto gate = modules::LinearModule( |
| 172 | binding::linear_config(config.hidden_size, ffn, false)) |
| 173 | .build(ctx, input, weights.gate_proj); |
| 174 | gate = modules::SiluModule{}.build(ctx, gate); |
| 175 | auto up = modules::LinearModule( |
| 176 | binding::linear_config(config.hidden_size, ffn, false)) |
| 177 | .build(ctx, input, weights.up_proj); |
| 178 | return modules::LinearModule( |
| 179 | binding::linear_config(ffn, config.hidden_size, false)) |
| 180 | .build(ctx, modules::MulModule{}.build(ctx, gate, up), weights.down_proj); |
| 181 | } |
| 182 | |
| 183 | core::TensorValue build_head_layer( |
| 184 | core::ModuleBuildContext & ctx, |
no test coverage detected