This commit is contained in:
josc146
2023-07-26 22:24:26 +08:00
parent 1df345b5eb
commit d0fd480bd6
9 changed files with 78 additions and 24 deletions

View File

@@ -42,7 +42,7 @@ class SwitchModelBody(BaseModel):
}
@router.post("/switch-model")
@router.post("/switch-model", tags=["Configs"])
def switch_model(body: SwitchModelBody, response: Response, request: Request):
if global_var.get(global_var.Model_Status) is global_var.ModelStatus.Loading:
response.status_code = Status.HTTP_304_NOT_MODIFIED
@@ -98,7 +98,7 @@ def switch_model(body: SwitchModelBody, response: Response, request: Request):
return "success"
@router.post("/update-config")
@router.post("/update-config", tags=["Configs"])
def update_config(body: ModelConfigBody):
"""
Will not update the model config immediately, but set it when completion called to avoid modifications during generation
@@ -110,7 +110,7 @@ def update_config(body: ModelConfigBody):
return "success"
@router.get("/status")
@router.get("/status", tags=["Configs"])
def status():
gpus = GPUtil.getGPUs()
if len(gpus) == 0: