Spaces:
Runtime error
Runtime error
Commit
Β·
e891fce
1
Parent(s):
e85dbfa
Update main.py
Browse files
main.py
CHANGED
@@ -33,9 +33,8 @@ class ChatCompletionRequest(BaseModel):
|
|
33 |
|
34 |
@app.post("/v1/chat/completions")
|
35 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
36 |
-
tokens = llm.tokenize(prompt)
|
37 |
async def server_sent_events(chat_chunks, llm):
|
38 |
-
yield prompt
|
39 |
for chat_chunk in llm.generate(chat_chunks):
|
40 |
yield llm.detokenize(chat_chunk)
|
41 |
yield ""
|
|
|
33 |
|
34 |
@app.post("/v1/chat/completions")
|
35 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
36 |
+
tokens = llm.tokenize(request.prompt)
|
37 |
async def server_sent_events(chat_chunks, llm):
|
|
|
38 |
for chat_chunk in llm.generate(chat_chunks):
|
39 |
yield llm.detokenize(chat_chunk)
|
40 |
yield ""
|