| 419 | } |
| 420 | |
| 421 | VibeVoiceTokenEmbeddings run(const std::vector<int32_t> & input_ids) { |
| 422 | const auto & config = runtime_->assets().config.decoder; |
| 423 | if (static_cast<int64_t>(input_ids.size()) != steps_) { |
| 424 | throw std::runtime_error("VibeVoice decoder embedding input size mismatch"); |
| 425 | } |
| 426 | ggml_backend_tensor_set(input_ids_, input_ids.data(), 0, input_ids.size() * sizeof(int32_t)); |
| 427 | core::set_backend_threads(runtime_->backend(), runtime_->threads()); |
| 428 | const ggml_status status = engine::core::compute_backend_graph(runtime_->backend(), graph_); |
| 429 | ggml_backend_synchronize(runtime_->backend()); |
| 430 | if (status != GGML_STATUS_SUCCESS) { |
| 431 | throw std::runtime_error("VibeVoice decoder embedding graph compute failed"); |
| 432 | } |
| 433 | |
| 434 | VibeVoiceTokenEmbeddings out; |
| 435 | out.steps = steps_; |
| 436 | out.hidden_size = config.hidden_size; |
| 437 | out.values.resize(static_cast<size_t>(steps_ * config.hidden_size)); |
| 438 | ggml_backend_tensor_get(output_, out.values.data(), 0, out.values.size() * sizeof(float)); |
| 439 | return out; |
| 440 | } |
| 441 | |
| 442 | private: |
| 443 | const VibeVoiceDecoderWeightsRuntime * runtime_ = nullptr; |
nothing calls this directly
no test coverage detected