[Dummy imports] Better error message
This PR adds from_config and from_pretrained dummy class methods to all dummy classes.
Running:
pytest -sv tests/test_pipelines.py::PipelineFastTests::test_stable_diffusion_k_lms
without scipy installed now yields:
E ImportError:
E LMSDiscreteScheduler requires the scipy library but it was not found in your environment. You can install it with pip: `pip install
E scipy`
as expected. Thanks for flagging @pcuenca
The documentation is not available anymore as the PR was closed or merged.
Very cool!
Loading the scheduler shows the nice error, but loading the pretrained pipeline still gives the cryptic message to me:
pipe = StableDiffusionPipeline.from_pretrained("hakurei/waifu-diffusion")
@patrickvonplaten I created a test to load a pipeline that uses the LMS Discrete scheduler. It currently fails with a cryptic error message if scipy is not installed. I'll try to debug it later.
If dummy_torch_and_scipy_objects.LMSDiscreteScheduler inherited from SchedulerMixin then it would be a load candidate and the nice error message would be presented. But I'm not sure how to achieve that with the current system.
Another option is to detect None here and show an error with the class name that we are attempting and failing to load.
What do you think?
@patrickvonplaten I created a test to load a pipeline that uses the LMS Discrete scheduler. It currently fails with a cryptic error message if
scipyis not installed. I'll try to debug it later.
Thanks, checking it out now!