Skip to content
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

Add test step before PyTorch is installed #24

Closed
wants to merge 1 commit into from

Conversation

polm
Copy link
Contributor

@polm polm commented Sep 27, 2022

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.

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.
@polm
Copy link
Contributor Author

polm commented Sep 27, 2022

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.

@polm polm closed this Sep 27, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant