allow unloading model with switch-model

This commit is contained in:
josc146 2023-06-12 12:34:03 +08:00
parent 5990567a79
commit bbd1ac1484

View File

@ -40,6 +40,9 @@ def switch_model(body: SwitchModelBody, response: Response, request: Request):
global_var.set(global_var.Model, None)
torch_gc()
if body.model == "":
return "success"
os.environ["RWKV_CUDA_ON"] = "1" if body.customCuda else "0"
global_var.set(global_var.Model_Status, global_var.ModelStatus.Loading)