Allow users to specify model type and skip detection step of probe

This commit is contained in:
Brandon Rising 2024-03-15 12:10:39 -04:00 committed by Brandon
parent f8df293d2c
commit 5feb62d440

View File

@ -132,12 +132,13 @@ class ModelProbe(object):
format_type = ModelFormat.Diffusers if model_path.is_dir() else ModelFormat.Checkpoint format_type = ModelFormat.Diffusers if model_path.is_dir() else ModelFormat.Checkpoint
model_info = None model_info = None
model_type = None model_type = fields['type'] if 'type' in fields else None
if format_type is ModelFormat.Diffusers: if not model_type:
model_type = cls.get_model_type_from_folder(model_path) if format_type is ModelFormat.Diffusers:
else: model_type = cls.get_model_type_from_folder(model_path)
model_type = cls.get_model_type_from_checkpoint(model_path) else:
format_type = ModelFormat.ONNX if model_type == ModelType.ONNX else format_type model_type = cls.get_model_type_from_checkpoint(model_path)
format_type = ModelFormat.ONNX if model_type == ModelType.ONNX else format_type
probe_class = cls.PROBES[format_type].get(model_type) probe_class = cls.PROBES[format_type].get(model_type)
if not probe_class: if not probe_class: