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 <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-03-16 22:57:45 -04:00 committed by Brian Dashore
parent 2755fd1af0
commit 95e44c20d6

View file

@ -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.'
)