From 2d4ced99b2974ed8df97ef4be7975683a5602d12 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Thu, 4 Dec 2025 13:49:34 +0800 Subject: [PATCH] Fix matcha tts --- sherpa-onnx/csrc/offline-tts-matcha-impl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sherpa-onnx/csrc/offline-tts-matcha-impl.h b/sherpa-onnx/csrc/offline-tts-matcha-impl.h index 2d1255ce64..92d7efff3d 100644 --- a/sherpa-onnx/csrc/offline-tts-matcha-impl.h +++ b/sherpa-onnx/csrc/offline-tts-matcha-impl.h @@ -431,10 +431,11 @@ class OfflineTtsMatchaImpl : public OfflineTtsImpl { std::vector x; x.reserve(num_tokens); + for (const auto &k : tokens) { + x.insert(x.end(), k.begin(), k.end()); + } + if (config_.model.debug) { - for (const auto &k : tokens) { - x.insert(x.end(), k.begin(), k.end()); - } std::ostringstream oss; for (int32_t i : x) { oss << i << ", ";