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

Method project_semantic_batch

src/models/vibevoice/connector.cpp:395–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395std::vector<VibeVoiceConnectorOutput> VibeVoiceConnectorWeightsRuntime::project_semantic_batch(
396 const std::vector<VibeVoiceTokenizerLatents> & features) const {
397 if (features.empty()) {
398 throw std::runtime_error("VibeVoice semantic connector batch requires non-empty features");
399 }
400 const int64_t frames = features.front().frames;
401 if (frames <= 0 || features.front().dim != weights_->semantic.input_dim) {
402 throw std::runtime_error("VibeVoice semantic connector batch received invalid feature shape");
403 }
404 for (const auto & item : features) {
405 if (item.frames != frames || item.dim != weights_->semantic.input_dim) {
406 throw std::runtime_error("VibeVoice semantic connector batch requires uniform feature shape");
407 }
408 }
409 const int64_t batch_size = static_cast<int64_t>(features.size());
410 if (semantic_graph_ == nullptr || !semantic_graph_->matches(weights_->semantic, batch_size, frames)) {
411 semantic_graph_.reset();
412 semantic_graph_ = std::make_unique<VibeVoiceConnectorGraph>(
413 *this,
414 weights_->semantic,
415 *semantic_constants_,
416 "vibevoice.connector.semantic",
417 batch_size,
418 frames,
419 64ull * 1024ull * 1024ull);
420 }
421 auto out = semantic_graph_->run_batch(features);
422 return out;
423}
424
425core::TensorValue build_vibevoice_connector(
426 core::ModuleBuildContext & ctx,

Callers 1

generate_vibevoice_batchFunction · 0.80

Calls 5

emptyMethod · 0.45
sizeMethod · 0.45
matchesMethod · 0.45
resetMethod · 0.45
run_batchMethod · 0.45

Tested by

no test coverage detected