MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / run

Method run

src/models/vibevoice/decoder.cpp:421–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
442private:
443 const VibeVoiceDecoderWeightsRuntime * runtime_ = nullptr;

Callers

nothing calls this directly

Calls 10

ggml_backend_tensor_setFunction · 0.85
set_backend_threadsFunction · 0.85
compute_backend_graphFunction · 0.85
ggml_backend_synchronizeFunction · 0.85
ggml_backend_tensor_getFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45
backendMethod · 0.45
threadsMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected