Spaces:
Paused
Paused
matthoffner
commited on
Commit
•
d1ec9ef
1
Parent(s):
1d9d2a2
Update main.py
Browse files
main.py
CHANGED
@@ -28,7 +28,7 @@ async def index():
|
|
28 |
return HTMLResponse(content=html_content, status_code=200)
|
29 |
|
30 |
class ChatCompletionRequest(BaseModel):
|
31 |
-
|
32 |
|
33 |
|
34 |
@app.get("/demo")
|
@@ -117,7 +117,7 @@ async def chat(prompt = "<|user|> Write a simple express style server in golang"
|
|
117 |
|
118 |
@app.post("/v1/chat/completions")
|
119 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
120 |
-
tokens = llm.tokenize(request.
|
121 |
async def server_sent_events(chat_chunks, llm):
|
122 |
for token in llm.generate(chat_chunks):
|
123 |
yield llm.detokenize(token)
|
|
|
28 |
return HTMLResponse(content=html_content, status_code=200)
|
29 |
|
30 |
class ChatCompletionRequest(BaseModel):
|
31 |
+
messages: str
|
32 |
|
33 |
|
34 |
@app.get("/demo")
|
|
|
117 |
|
118 |
@app.post("/v1/chat/completions")
|
119 |
async def chat(request: ChatCompletionRequest, response_mode=None):
|
120 |
+
tokens = llm.tokenize(request.messages.join(''))
|
121 |
async def server_sent_events(chat_chunks, llm):
|
122 |
for token in llm.generate(chat_chunks):
|
123 |
yield llm.detokenize(token)
|