Skip to content

Better error message for unsupported classes #794

@pcuenca

Description

@pcuenca

Case in point: attempting to load a pipeline that uses the k-LMS scheduler using from_pretrained without scipy installed fails here because load_method_name is None. The error the user sees is:

Traceback (most recent call last):
  File "app.py", line 7, in <module>
    pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/diffusers/pipeline_utils.py", line 457, in from_pretrained
    load_method = getattr(class_obj, load_method_name)
TypeError: getattr(): attribute name must be string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions