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

Function make_streaming_cache_input

src/models/vibevoice/tokenizer_audio.cpp:552–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550};
551
552core::TensorValue make_streaming_cache_input(
553 core::ModuleBuildContext & ctx,
554 VibeVoiceStreamingBuildState & state,
555 int64_t batch,
556 int64_t channels,
557 int64_t frames) {
558 if (batch <= 0 || channels <= 0 || frames <= 0) {
559 throw std::runtime_error("VibeVoice streaming cache input requires positive dimensions");
560 }
561 auto * tensor = ggml_new_tensor_3d(ctx.ggml, GGML_TYPE_F32, frames, channels, batch);
562 ggml_set_input(tensor);
563 state.cache_inputs.push_back(tensor);
564 state.cache_bytes.push_back(static_cast<size_t>(batch * channels * frames) * sizeof(float));
565 return core::wrap_tensor(tensor, core::TensorShape::from_dims({batch, channels, frames}), GGML_TYPE_F32);
566}
567
568void add_streaming_cache_output(
569 core::ModuleBuildContext & ctx,

Callers 3

sconv1d_streamingFunction · 0.85

Calls 3

ggml_new_tensor_3dFunction · 0.85
ggml_set_inputFunction · 0.85
wrap_tensorFunction · 0.85

Tested by

no test coverage detected