| 472 | } |
| 473 | |
| 474 | VibeVoiceDiffusionPrediction VibeVoiceDiffusionHeadWeightsRuntime::predict( |
| 475 | const std::vector<float> & noisy_images, |
| 476 | int64_t frames, |
| 477 | int64_t latent_size, |
| 478 | float timestep, |
| 479 | const std::vector<float> & condition, |
| 480 | int64_t condition_hidden_size) const { |
| 481 | const auto & config = assets_->config.diffusion_head; |
| 482 | if (frames <= 0 || latent_size != config.latent_size || condition_hidden_size != config.hidden_size) { |
| 483 | throw std::runtime_error("VibeVoice diffusion head received invalid input shape"); |
| 484 | } |
| 485 | if (graph_ == nullptr || !graph_->matches(*this, frames)) { |
| 486 | graph_.reset(); |
| 487 | graph_ = std::make_unique<VibeVoiceDiffusionHeadGraph>( |
| 488 | *this, |
| 489 | frames, |
| 490 | 128ull * 1024ull * 1024ull); |
| 491 | } |
| 492 | return graph_->run(noisy_images, latent_size, timestep, condition, condition_hidden_size); |
| 493 | } |
| 494 | |
| 495 | core::TensorValue build_vibevoice_diffusion_head( |
| 496 | core::ModuleBuildContext & ctx, |
no test coverage detected