Skip to content

Commit 397d3a5

Browse files
committed
dealing with empty "sentence"
1 parent fb0c540 commit 397d3a5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

models/qwen.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3508,7 +3508,8 @@ namespace chatllm::qwen::v3_forcedaligner
35083508
auto &w = tok->cleaned_words[i];
35093509
if (w.parent_id >= (int)tok->timestamps.size())
35103510
{
3511-
CHATLLM_CHECK(w.parent_id == (int)tok->timestamps.size());
3511+
while (w.parent_id > (int)tok->timestamps.size())
3512+
tok->timestamps.emplace_back(0.0, 0.0);
35123513
tok->timestamps.emplace_back(timestamps[2 * i + 0], timestamps[2 * i + 1]);
35133514
}
35143515
else
@@ -3518,6 +3519,9 @@ namespace chatllm::qwen::v3_forcedaligner
35183519
}
35193520
}
35203521

3522+
while (tok->timestamps.size() < tok->sentences.size())
3523+
tok->timestamps.emplace_back(0.0, 0.0);
3524+
35213525
if (streamer)
35223526
{
35233527
auto r = tok->show_timestampes();

0 commit comments

Comments
 (0)