From 2ecdc4e607f381b8231e3ef1484d3b73cbbebb97 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sun, 4 Aug 2024 16:51:17 +0800 Subject: [PATCH] Fix text conversion for Chinese language --- whisper_fastapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/whisper_fastapi.py b/whisper_fastapi.py index 50fc6b6..a7d538f 100644 --- a/whisper_fastapi.py +++ b/whisper_fastapi.py @@ -144,7 +144,8 @@ def stream_builder( data = segment._asdict() if data.get('words') is not None: data["words"] = [i._asdict() for i in data["words"]] - data["text"] = ccc.convert(data["text"]) + if info.language == "zh": + data["text"] = ccc.convert(data["text"]) yield data info_dict = info._asdict()