Spaces:
Runtime error
Runtime error
Commit
Β·
c08a662
1
Parent(s):
21f8b1c
Update main.py
Browse files
main.py
CHANGED
@@ -68,11 +68,11 @@ async def chat(prompt = "I want to download a dataset from GCS"):
|
|
68 |
|
69 |
|
70 |
class ChatCompletionRequest(BaseModel):
|
71 |
-
|
72 |
|
73 |
@app.post("/v1/chat/completions")
|
74 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
75 |
-
tokens = llm.tokenize(request.
|
76 |
async def server_sent_events(chat_chunks, llm):
|
77 |
for chat_chunk in llm.generate(chat_chunks):
|
78 |
yield llm.detokenize(chat_chunk)
|
|
|
68 |
|
69 |
|
70 |
class ChatCompletionRequest(BaseModel):
|
71 |
+
messages: str
|
72 |
|
73 |
@app.post("/v1/chat/completions")
|
74 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
75 |
+
tokens = llm.tokenize(request.messages.join(' '))
|
76 |
async def server_sent_events(chat_chunks, llm):
|
77 |
for chat_chunk in llm.generate(chat_chunks):
|
78 |
yield llm.detokenize(chat_chunk)
|