matthoffner commited on
Commit
882b099
1 Parent(s): c6c8fb5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -4
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: 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):
 
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):