Add test step before PyTorch is installed#24
Closed
polm wants to merge 1 commit into
Closed
Conversation
spacy-experimental is supposed to be safe to load without PyTorch, even if large parts of it aren't functional, but that wasn't checked in tests. This adds a check for that by simply running the tests before installing PyTorch and again afterwards.
polm
added a commit
that referenced
this pull request
Sep 27, 2022
This is the same as the changes from #24, since they worked.
Contributor
Author
|
Since this worked as expected, and this PR confirmed master was failing, I have just included the changes in the other PR, and will close this one. |
adrianeboyd
pushed a commit
that referenced
this pull request
Sep 28, 2022
* Make coref entry points work without torch Before this PR, in environments without PyTorch, using spacy experimental can fail due to attempts to load entry points. This change makes it so the types required for class definitions (torch.nn.Module and torch.Tensor) are stubbed to object when torch is not available. * Add explanatory comment * Use has_torch instead of looking for AttributeError * Add clear errors when attempting to use coref without torch Without this, it could be unclear why coref didn't work without torch. * Move Pytorch implementations to separate files This follows the model of the biaffine parser. * Fix model name * Run tests with and without PyTorch This is the same as the changes from #24, since they worked. * Remove unused imports in coref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spacy-experimental is supposed to be safe to load without PyTorch, even if large parts of it aren't functional, but that wasn't checked in tests. This adds a check for that by simply running the tests before installing PyTorch and again afterwards.
Given the current state of master, which doesn't have #23, this should fail.