diff --git a/llmage/llmclient.py b/llmage/llmclient.py index cf97f97..da36075 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -76,9 +76,10 @@ async def uapi_request(request, sor, caller_orgid, callerid, uapi, llm, params): userid = await get_owner_userid(sor, llm) txt = '' async for l in uapi.stream_linify(llm.upappid, llm.apiname, userid, params=params): - d = json.loads(l) - txt = txt + d['content'] - yield l + if l != '[DONE]': + d = json.loads(l) + txt = txt + d['content'] + yield l debug(f'{d=}, {txt=}') async def inference(request, *args, **kw):