Skip to content

Add test step before PyTorch is installed#24

Closed
polm wants to merge 1 commit into
masterfrom
fix/test-without-torch
Closed

Add test step before PyTorch is installed#24
polm wants to merge 1 commit into
masterfrom
fix/test-without-torch

Conversation

@polm

@polm polm commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

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

polm commented Sep 27, 2022

Copy link
Copy Markdown
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.

@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

Development

Successfully merging this pull request may close these issues.

1 participant