From 95e44c20d63dcd0b90ac99faeca55bb1f832d961 Mon Sep 17 00:00:00 2001 From: kingbri Date: Sat, 16 Mar 2024 22:57:45 -0400 Subject: [PATCH] Model: Fix load if model didn't load properly If the model didn't load properly, the container still exists until unload is called. However, the name check still registered as true. Signed-off-by: kingbri --- common/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/model.py b/common/model.py index 5608c9f..6b2d212 100644 --- a/common/model.py +++ b/common/model.py @@ -33,7 +33,7 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs): if container and container.model: loaded_model_name = container.get_model_path().name - if loaded_model_name == model_path.name: + if loaded_model_name == model_path.name and container.model_loaded: raise ValueError( f'Model "{loaded_model_name}" is already loaded! Aborting.' )