send done for textcompletions too

This commit is contained in:
Concedo 2024-02-13 23:39:00 +08:00
parent 99b7cf7d1c
commit 39f8cbd1f3

View file

@ -691,7 +691,7 @@ class ServerRequestHandler(http.server.SimpleHTTPRequestHandler):
await asyncio.sleep(0.02) #this should keep things responsive
if streamDone:
if api_format == 4: # if oai chat, send last [DONE] message consistent with openai format
if api_format == 4 or api_format == 3: # if oai chat, send last [DONE] message consistent with openai format
await self.send_oai_sse_event('[DONE]')
break
except Exception as ex: