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

Method run

src/models/vibevoice/connector.cpp:134–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 2

project_acousticMethod · 0.45
project_semanticMethod · 0.45

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