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
Improving Pipelines by defaulting to framework='tf' when pytorch seems unavailable. #7728
Conversation
pytorch seems unavailable.
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.
LGTM, thanks @Narsil!
Actually, This introduced a pretty big bug where nlp = pipeline(task) Would not work anymore. I tried a different solution around that. |
defaults Adding a new tests for each pipeline to check that pipeline(task) works too without manually adding the framework too.
97cc165
to
d8100a7
Compare
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.
Cool, great that you completed the CI.
@@ -823,3 +833,4 @@ def test_pt_defaults(self): | |||
for task in self.pipelines: | |||
with self.subTest(msg="Testing Torch defaults with PyTorch and {}".format(task)): | |||
pipeline(task, framework="pt") | |||
pipeline(task) |
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.
Thanks for completing the suite!
…s unavailable. (huggingface#7728) * Improving Pipelines by defaulting to framework='tf' when pytorch seems unavailable. * Actually changing the default resolution order to account for model defaults Adding a new tests for each pipeline to check that pipeline(task) works too without manually adding the framework too.
…rch seems unavailable. (huggingface#7728)" This reverts commit e7cf706.
What does this PR do?
When loading a model that was
tf
only and by passing only model by string without framework argument, it would fail with an odd error message:This PR corrects the
get_framework
that happens very early in the pipeline to detect the type of modelautomatically. It does trigger an early download, but that will happen anyway later.
Before submitting
Pull Request section?
to the it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.
@mfuntowicz