-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[Dummy imports] Better error message #795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
| requires_backends(self, {1}) | ||
| @classmethod | ||
| def from_config(cls, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding from_config and from_pretrained is quite simple here
|
Very cool! Loading the scheduler shows the nice error, but loading the pretrained pipeline still gives the cryptic message to me: |
Fails with a cryptic message if scipy is not installed.
|
@patrickvonplaten I created a test to load a pipeline that uses the LMS Discrete scheduler. It currently fails with a cryptic error message if |
|
If Another option is to detect What do you think? |
Thanks, checking it out now! |
| assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2 | ||
| assert np.abs(image_from_tuple_slice.flatten() - expected_slice).max() < 1e-2 | ||
|
|
||
| def test_from_pretrained_error_message_uninstalled_packages(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pcuenca - I can't think of a good way to test that we have a nice error message going forward. Suggest to just merge without a good test for now. Let me know if you have other ideas!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is not as important as the real use in the wild, like what happened with that Space that broke. If users see something reasonable instead of the previous cryptic message, then I'm all for it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the test as it's now doesn't really help at all 😅 I was just wondering if there is a way to "pretend" scipy is not installed and then verify that the error message is nice
* [Dummy imports] Better error message * Test: load pipeline with LMS scheduler. Fails with a cryptic message if scipy is not installed. * Correct Co-authored-by: Pedro Cuenca <[email protected]>
* [Dummy imports] Better error message * Test: load pipeline with LMS scheduler. Fails with a cryptic message if scipy is not installed. * Correct Co-authored-by: Pedro Cuenca <[email protected]>
This PR adds
from_configandfrom_pretraineddummy class methods to all dummy classes.Running:
without
scipyinstalled now yields:as expected. Thanks for flagging @pcuenca