From ddda2c4c27664a59b3f6ba04f47c0398aad2a180 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Fri, 22 Mar 2024 07:48:33 -0400 Subject: [PATCH] improve text output format --- voice2text_deltabot/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voice2text_deltabot/hooks.py b/voice2text_deltabot/hooks.py index 6e1f19d..e59b81c 100644 --- a/voice2text_deltabot/hooks.py +++ b/voice2text_deltabot/hooks.py @@ -77,7 +77,7 @@ def on_newmsg(bot: Bot, accid: int, event: AttrDict) -> None: if msg.view_type in (ViewType.VOICE, ViewType.AUDIO): start = time.time() segments, info = MODEL.transcribe(msg.file) - text = " ".join(seg.text for seg in segments) + text = "\n".join(seg.text.strip() for seg in segments) took = time.time() - start percent = int(info.language_probability * 100) bot.logger.info(