mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-14 02:08:32 +01:00
Don't scan safetensors files in load_default_models() (#1155)
* Don't scan safetensors when loading them * Don't scan safetensors files * Update model_manager.py --------- Co-authored-by: cmdr2 <shashank.shekhar.global@gmail.com>
This commit is contained in:
parent
03c8a0fca5
commit
4192f87d6b
@ -41,12 +41,15 @@ def load_default_models(context: Context):
|
||||
for model_type in MODELS_TO_LOAD_ON_START:
|
||||
context.model_paths[model_type] = resolve_model_to_use(model_type=model_type)
|
||||
try:
|
||||
load_model(context, model_type)
|
||||
load_model(
|
||||
context,
|
||||
model_type,
|
||||
scan_model = context.model_paths[model_type] != None and not context.model_paths[model_type].endswith('.safetensors')
|
||||
)
|
||||
except Exception as e:
|
||||
log.error(f"[red]Error while loading {model_type} model: {context.model_paths[model_type]}[/red]")
|
||||
log.exception(e)
|
||||
|
||||
|
||||
def unload_all(context: Context):
|
||||
for model_type in KNOWN_MODEL_TYPES:
|
||||
unload_model(context, model_type)
|
||||
|
Loading…
Reference in New Issue
Block a user