From bbd1ac1484994f66d0fb0b0bcc9971f61629b627 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 12 Jun 2023 12:34:03 +0800 Subject: [PATCH] allow unloading model with switch-model --- backend-python/routes/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend-python/routes/config.py b/backend-python/routes/config.py index e478aa2..4d3bb4b 100644 --- a/backend-python/routes/config.py +++ b/backend-python/routes/config.py @@ -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)