Unverified Commit ca1dc1e7 authored by Atream's avatar Atream Committed by GitHub
Browse files

Merge branch 'main' into main

parents d3b45d57 505f4e2c
......@@ -105,6 +105,7 @@ def custom_openapi(app):
def main():
cfg = Config()
arg_parser = ArgumentParser(cfg)
# 初始化消息
......
......@@ -73,7 +73,7 @@ class RunStepDelta(Object):
class Done():
def to_stream_reply(self):
return f"event: done\ndata: [DONE]\n\n"
return f"data: [DONE]\n\n"
async def check_client_link(request: Request, async_events: AsyncIterable):
......
......@@ -25,7 +25,9 @@ class ChatCompletionCreate(BaseModel):
messages: List[Message]
model : str
stream : bool = False
temperature: Optional[float] = None
top_p: Optional[float] = None
def get_tokenizer_messages(self):
return [m.to_tokenizer_message() for m in self.messages]
......@@ -75,4 +77,4 @@ class ChatCompletionChunk(ChatCompletionBase):
]
def to_stream_reply(self):
return f"data:{self.model_dump_json()}\n\n"
return f"data: {self.model_dump_json()}\n\n"
......@@ -9,6 +9,8 @@ class CompletionCreate(BaseModel):
model: str
prompt: str | List[str]
stream: bool = False
temperature: Optional[float] = None
top_p: Optional[float] = None
def get_tokenizer_messages(self):
if isinstance(self.prompt,List):
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,4 +4,6 @@ numpy
torch>=2.3.0
packaging
cpufeature
protobuf
\ No newline at end of file
protobuf
tiktoken
blobfile
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment