fix /docs default api params (Pydantic v2)

This commit is contained in:
josc146
2023-11-07 22:53:11 +08:00
parent 26d4c9f0ed
commit cfa3669f6f
4 changed files with 27 additions and 18 deletions

View File

@@ -16,8 +16,8 @@ class SwitchModelBody(BaseModel):
tokenizer: Union[str, None] = None
customCuda: bool = False
class Config:
json_schema_extra = {
model_config = {
"json_schema_extra": {
"example": {
"model": "models/RWKV-4-World-3B-v1-20230619-ctx4096.pth",
"strategy": "cuda fp16",
@@ -25,6 +25,7 @@ class SwitchModelBody(BaseModel):
"customCuda": False,
}
}
}
@router.post("/switch-model", tags=["Configs"])