| 132 | } |
| 133 | |
| 134 | VibeVoiceConnectorOutput run(const std::vector<float> & features, int64_t input_dim) { |
| 135 | if (input_dim != weights_->input_dim) { |
| 136 | throw std::runtime_error("VibeVoice connector input_dim mismatch"); |
| 137 | } |
| 138 | if (static_cast<int64_t>(features.size()) != frames_ * input_dim) { |
| 139 | throw std::runtime_error("VibeVoice connector feature payload size mismatch"); |
| 140 | } |
| 141 | ggml_backend_tensor_set(input_, features.data(), 0, features.size() * sizeof(float)); |
| 142 | core::set_backend_threads(runtime_->backend(), runtime_->threads()); |
| 143 | const ggml_status status = engine::core::compute_backend_graph(runtime_->backend(), graph_); |
| 144 | ggml_backend_synchronize(runtime_->backend()); |
| 145 | if (status != GGML_STATUS_SUCCESS) { |
| 146 | throw std::runtime_error("VibeVoice connector graph compute failed"); |
| 147 | } |
| 148 | VibeVoiceConnectorOutput out; |
| 149 | out.frames = frames_; |
| 150 | out.hidden_size = weights_->hidden_size; |
| 151 | out.values.resize(static_cast<size_t>(frames_ * weights_->hidden_size)); |
| 152 | ggml_backend_tensor_get(output_, out.values.data(), 0, out.values.size() * sizeof(float)); |
| 153 | return out; |
| 154 | } |
| 155 | |
| 156 | std::vector<VibeVoiceConnectorOutput> run_batch( |
| 157 | const std::vector<VibeVoiceTokenizerLatents> & features) { |
no test coverage detected