Reload the model if the path exists in the request but the model has been unloaded

This commit is contained in:
cmdr2 2023-08-03 15:13:41 +05:30
parent 6a95c602b1
commit 9a528496a3

View File

@ -148,7 +148,7 @@ def reload_models_if_necessary(context: Context, models_data: ModelsData, models
models_to_reload = { models_to_reload = {
model_type: path model_type: path
for model_type, path in models_data.model_paths.items() for model_type, path in models_data.model_paths.items()
if context.model_paths.get(model_type) != path if context.model_paths.get(model_type) != path or (path is not None and context.models.get(model_type) is None)
} }
if models_data.model_paths.get("codeformer"): if models_data.model_paths.get("codeformer"):