| 405 | } |
| 406 | |
| 407 | core::TensorValue zero_like_frames(core::ModuleBuildContext & ctx, const core::TensorValue & input, int64_t frames) { |
| 408 | if (frames <= 0) { |
| 409 | throw std::runtime_error("VibeVoice tokenizer zero frame template requires positive frame count"); |
| 410 | } |
| 411 | auto one = modules::SliceModule({2, 0, 1}).build(ctx, input); |
| 412 | if (one.type != GGML_TYPE_F32) { |
| 413 | one = core::wrap_tensor(ggml_cast(ctx.ggml, one.tensor, GGML_TYPE_F32), one.shape, GGML_TYPE_F32); |
| 414 | } |
| 415 | auto repeated = modules::RepeatModule({ |
| 416 | core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], frames})}).build(ctx, one); |
| 417 | return core::wrap_tensor(ggml_scale(ctx.ggml, repeated.tensor, 0.0F), repeated.shape, GGML_TYPE_F32); |
| 418 | } |
| 419 | |
| 420 | core::TensorValue constant_pad_frames( |
| 421 | core::ModuleBuildContext & ctx, |
no test coverage detected