matt HOFFNER commited on
Commit
4ebc12a
1 Parent(s): 8b67d79
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -139,8 +139,8 @@ async def chat(request: ChatCompletionRequest, response_mode=None):
139
  tokens = llm.tokenize(prompt)
140
  async def server_sent_events(chat_chunks, llm):
141
  for token in llm.generate(chat_chunks):
142
- yield llm.detokenize(token)
143
- yield ""
144
 
145
  return EventSourceResponse(server_sent_events(tokens, llm))
146
 
 
139
  tokens = llm.tokenize(prompt)
140
  async def server_sent_events(chat_chunks, llm):
141
  for token in llm.generate(chat_chunks):
142
+ yield dict(data=llm.detokenize(token))
143
+ yield dict(data="[DONE]")
144
 
145
  return EventSourceResponse(server_sent_events(tokens, llm))
146