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

Method VibeVoiceDecoderWeightsRuntime

src/models/vibevoice/decoder.cpp:1470–1507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1468VibeVoiceDecoderCachedState & VibeVoiceDecoderCachedState::operator=(VibeVoiceDecoderCachedState &&) noexcept = default;
1469
1470VibeVoiceDecoderWeightsRuntime::VibeVoiceDecoderWeightsRuntime(
1471 std::shared_ptr<const VibeVoiceAssets> assets,
1472 core::BackendType backend_type,
1473 int device,
1474 int threads,
1475 size_t weight_context_bytes,
1476 size_t constant_context_bytes,
1477 assets::TensorStorageType weight_storage_type)
1478 : assets_(std::move(assets)),
1479 threads_(threads) {
1480 if (assets_ == nullptr) {
1481 throw std::runtime_error("VibeVoice decoder weights runtime requires assets");
1482 }
1483 if (threads_ <= 0) {
1484 throw std::runtime_error("VibeVoice decoder weights runtime requires positive thread count");
1485 }
1486 const auto backend_started = std::chrono::steady_clock::now();
1487 backend_ = core::init_backend({backend_type, device, threads_});
1488 engine::debug::timing_log_scalar(
1489 "vibevoice.runtime.decoder_backend_init_ms",
1490 engine::debug::elapsed_ms(backend_started));
1491 const auto weights_started = std::chrono::steady_clock::now();
1492 weights_ = std::make_shared<VibeVoiceDecoderWeights>(
1493 load_vibevoice_decoder_weights(
1494 *assets_,
1495 backend_,
1496 backend_type,
1497 weight_context_bytes,
1498 weight_storage_type));
1499 engine::debug::timing_log_scalar(
1500 "vibevoice.runtime.decoder_weights_load_ms",
1501 engine::debug::elapsed_ms(weights_started));
1502 constants_ = std::make_unique<core::ConstantTensorCache>(
1503 backend_,
1504 threads_,
1505 "vibevoice.decoder.constants",
1506 constant_context_bytes);
1507}
1508
1509VibeVoiceDecoderWeightsRuntime::~VibeVoiceDecoderWeightsRuntime() {
1510 cached_batch_graphs_.clear();

Callers

nothing calls this directly

Calls 4

init_backendFunction · 0.85
timing_log_scalarFunction · 0.50
elapsed_msFunction · 0.50

Tested by

no test coverage detected