Spaces:
Paused
Paused
matt HOFFNER
commited on
Commit
•
4ebc12a
1
Parent(s):
8b67d79
json
Browse files
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 |
|