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

Method build_prompt

src/models/qwen3_forced_aligner/processor.cpp:265–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 result[k] = (k - (i - 1)) <= (j - k) ? left : right;
264 }
265 }
266 } else {
267 for (size_t k = i; k < j; ++k) {
268 if (has_left && has_right) {
269 const double step = static_cast<double>(right - left) / static_cast<double>(anomaly_count + 1);
270 result[k] = static_cast<int64_t>(left + step * static_cast<double>(k - i + 1));
271 } else if (has_left) {
272 result[k] = left;
273 } else if (has_right) {
274 result[k] = right;
275 }
276 }
277 }
278 i = j;
279 }
280 return result;
281}
282
283} // namespace
284
285Qwen3ForcedAlignProcessor::Qwen3ForcedAlignProcessor(
286 const engine::models::qwen3_asr::Qwen3ASRAssets & assets,
287 const engine::models::qwen3_asr::Qwen3ASRTextTokenizer & tokenizer)
288 : assets_(assets),
289 tokenizer_(tokenizer) {}
290
291Qwen3ForcedAlignProcessor::~Qwen3ForcedAlignProcessor() = default;
292
293std::vector<std::string> Qwen3ForcedAlignProcessor::tokenize_words(
294 const std::string & text,
295 const std::string & language) const {
296 std::vector<std::string> words;
297 // The upstream Japanese/Korean tokenizers retain Unicode letters/numbers
298 // and apostrophes. Do not use the legacy broad codepoint ranges here:
299 // those also retain Japanese punctuation and omit Hangul jamo.

Callers 1

run_singleMethod · 0.45

Calls 6

tokenize_chinese_mixedFunction · 0.85
tokenize_space_languageFunction · 0.85
lower_asciiFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected