From fa59cc472400a5664ac7fa339724ccacb81b768b Mon Sep 17 00:00:00 2001 From: Spockhh <2402728068@qq.com> Date: Thu, 16 Nov 2023 13:41:28 +0800 Subject: [PATCH] =?UTF-8?q?Update=20async=5Fengine.py=20=EF=BF=BD=20checki?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit � can appear in anywhere of a block in a stream. --- lmdeploy/serve/async_engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmdeploy/serve/async_engine.py b/lmdeploy/serve/async_engine.py index 5abae0d97a..668188e4cb 100644 --- a/lmdeploy/serve/async_engine.py +++ b/lmdeploy/serve/async_engine.py @@ -239,7 +239,7 @@ async def generate( # utf-8 char at the end means it's a potential unfinished # byte sequence, continue to concate it with the next # sequence and decode them together - if response.endswith('�'): + if '�' in response: continue # response, history token len, # input token len, gen token len