diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Better error message for unsupported classes

Open pcuenca opened this issue 3 years ago • 0 comments

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

pcuenca avatar Oct 10 '22 16:10 pcuenca