Spaces:
Paused
Paused
Commit
·
882b099
1
Parent(s):
c6c8fb5
Update main.py
Browse files
main.py
CHANGED
|
@@ -27,9 +27,6 @@ async def index():
|
|
| 27 |
html_content = markdown.markdown(md_template_string)
|
| 28 |
return HTMLResponse(content=html_content, status_code=200)
|
| 29 |
|
| 30 |
-
class ChatCompletionRequest(BaseModel):
|
| 31 |
-
messages: any
|
| 32 |
-
|
| 33 |
|
| 34 |
@app.get("/demo")
|
| 35 |
async def demo():
|
|
@@ -116,7 +113,7 @@ async def chat(prompt = "<|user|> Write a simple express style server in golang"
|
|
| 116 |
return EventSourceResponse(server_sent_events(tokens, llm))
|
| 117 |
|
| 118 |
@app.post("/v1/chat/completions")
|
| 119 |
-
async def chat(request
|
| 120 |
tokens = llm.tokenize(request.messages.join(''))
|
| 121 |
async def server_sent_events(chat_chunks, llm):
|
| 122 |
for token in llm.generate(chat_chunks):
|
|
|
|
| 27 |
html_content = markdown.markdown(md_template_string)
|
| 28 |
return HTMLResponse(content=html_content, status_code=200)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
@app.get("/demo")
|
| 32 |
async def demo():
|
|
|
|
| 113 |
return EventSourceResponse(server_sent_events(tokens, llm))
|
| 114 |
|
| 115 |
@app.post("/v1/chat/completions")
|
| 116 |
+
async def chat(request, response_mode=None):
|
| 117 |
tokens = llm.tokenize(request.messages.join(''))
|
| 118 |
async def server_sent_events(chat_chunks, llm):
|
| 119 |
for token in llm.generate(chat_chunks):
|