allow completions input to be null
This commit is contained in:
parent
bcf6409536
commit
91e2828a95
@ -22,18 +22,18 @@ class Message(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class ChatCompletionBody(ModelConfigBody):
|
class ChatCompletionBody(ModelConfigBody):
|
||||||
messages: List[Message]
|
messages: Union[List[Message], None]
|
||||||
model: str = "rwkv"
|
model: str = "rwkv"
|
||||||
stream: bool = False
|
stream: bool = False
|
||||||
stop: Union[str, List[str]] = [
|
stop: Union[str, List[str], None] = [
|
||||||
"\n\nUser",
|
"\n\nUser",
|
||||||
"\n\nQuestion",
|
"\n\nQuestion",
|
||||||
"\n\nQ",
|
"\n\nQ",
|
||||||
"\n\nHuman",
|
"\n\nHuman",
|
||||||
"\n\nBob",
|
"\n\nBob",
|
||||||
]
|
]
|
||||||
user_name: str = None
|
user_name: Union[str, None] = None
|
||||||
assistant_name: str = None
|
assistant_name: Union[str, None] = None
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
schema_extra = {
|
schema_extra = {
|
||||||
@ -54,10 +54,10 @@ class ChatCompletionBody(ModelConfigBody):
|
|||||||
|
|
||||||
|
|
||||||
class CompletionBody(ModelConfigBody):
|
class CompletionBody(ModelConfigBody):
|
||||||
prompt: Union[str, List[str]]
|
prompt: Union[str, List[str], None]
|
||||||
model: str = "rwkv"
|
model: str = "rwkv"
|
||||||
stream: bool = False
|
stream: bool = False
|
||||||
stop: Union[str, List[str]] = None
|
stop: Union[str, List[str], None] = None
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
schema_extra = {
|
schema_extra = {
|
||||||
@ -87,7 +87,7 @@ async def eval_rwkv(
|
|||||||
body: ModelConfigBody,
|
body: ModelConfigBody,
|
||||||
prompt: str,
|
prompt: str,
|
||||||
stream: bool,
|
stream: bool,
|
||||||
stop: Union[str, List[str]],
|
stop: Union[str, List[str], None],
|
||||||
chat_mode: bool,
|
chat_mode: bool,
|
||||||
):
|
):
|
||||||
global requests_num
|
global requests_num
|
||||||
@ -345,7 +345,7 @@ async def completions(body: CompletionBody, request: Request):
|
|||||||
|
|
||||||
|
|
||||||
class EmbeddingsBody(BaseModel):
|
class EmbeddingsBody(BaseModel):
|
||||||
input: Union[str, List[str], List[List[int]]]
|
input: Union[str, List[str], List[List[int]], None]
|
||||||
model: str = "rwkv"
|
model: str = "rwkv"
|
||||||
encoding_format: str = None
|
encoding_format: str = None
|
||||||
fast_mode: bool = False
|
fast_mode: bool = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user