diff --git a/llmage/llmclient.py b/llmage/llmclient.py index 65c276e..468c6cf 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -100,6 +100,8 @@ async def uapi_request(request, llm, sor): params=env.params_kw): if isinstance(l, bytes): l = l.decode('utf-8') + if l[-1] == '\n': + l = l[:-1] debug(f'stream response line={l},{type(l)}') l = ''.join(l.split('\n')) if l and l != '[DONE]':