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

Function project_code_predictor_input

src/models/qwen3_tts/talker.cpp:479–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477 }
478 std::vector<float> output(static_cast<size_t>(ids.size() * static_cast<size_t>(dim)), 0.0F);
479 for (size_t row = 0; row < ids.size(); ++row) {
480 const int32_t id = ids[row];
481 if (id < 0 || id >= table.shape.dims[0]) {
482 throw std::runtime_error("Qwen3 talker embedding id out of range");
483 }
484 auto * dst = output.data() + row * static_cast<size_t>(dim);
485 const size_t offset = static_cast<size_t>(id) * row_bytes;
486 const auto * src = table.bytes.data() + static_cast<std::ptrdiff_t>(offset);
487 if (table.type == GGML_TYPE_F32) {
488 const auto * values = reinterpret_cast<const float *>(src);
489 std::copy(values, values + dim, dst);
490 } else if (table.type == GGML_TYPE_F16) {
491 ggml_fp16_to_fp32_row(reinterpret_cast<const ggml_fp16_t *>(src), dst, dim);
492 } else if (table.type == GGML_TYPE_BF16) {
493 ggml_bf16_to_fp32_row(reinterpret_cast<const ggml_bf16_t *>(src), dst, dim);
494 } else {
495 throw std::runtime_error("Qwen3 talker embedding table must be f32, f16, or bf16");
496 }
497 }

Callers 2

build_prefill_graphMethod · 0.85
build_step_graphMethod · 0.85

Calls 3

LinearModuleClass · 0.85
linear_dataFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected