Skip to content

Commit

Permalink
Fix v4 branch to build against Thinc v9 (explosion#11921)
Browse files Browse the repository at this point in the history
* Move `thinc.extra.search` to `spacy.pipeline._parser_internals`

Backport of:
explosion#11317

Co-authored-by: Madeesh Kannan <[email protected]>

* Replace references to `thinc.backends.linalg` with `CBlas`

Backport of:
explosion#11292

Co-authored-by: Madeesh Kannan <[email protected]>

* Use cross entropy from `thinc.legacy`

* Require thinc>=9.0.0.dev0,<9.1.0

Co-authored-by: Madeesh Kannan <[email protected]>
  • Loading branch information
2 people authored and jikanter committed May 21, 2024
1 parent d433046 commit 8a1f153
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ requires = [
"cymem>=2.0.2,<2.1.0",
"preshed>=3.0.2,<3.1.0",
"murmurhash>=0.28.0,<1.1.0",
"thinc>=8.2.2,<8.3.0",
"numpy>=1.15.0; python_version < '3.9'",
"numpy>=1.25.0; python_version >= '3.9'",
"thinc>=9.0.0.dev0,<9.1.0",
"numpy>=1.15.0",
]
build-backend = "setuptools.build_meta"

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spacy-legacy>=4.0.0.dev1,<4.1.0
spacy-loggers>=1.0.0,<2.0.0
cymem>=2.0.2,<2.1.0
preshed>=3.0.2,<3.1.0
thinc>=8.2.2,<8.3.0
thinc>=9.0.0.dev0,<9.1.0
ml_datasets>=0.2.0,<0.3.0
murmurhash>=0.28.0,<1.1.0
wasabi>=0.9.1,<1.2.0
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ install_requires =
murmurhash>=0.28.0,<1.1.0
cymem>=2.0.2,<2.1.0
preshed>=3.0.2,<3.1.0
thinc>=8.2.2,<8.3.0
wasabi>=0.9.1,<1.2.0
thinc>=9.0.0.dev0,<9.1.0
wasabi>=0.9.1,<1.1.0
srsly>=2.4.3,<3.0.0
catalogue>=2.0.6,<2.1.0
weasel>=0.1.0,<0.5.0
Expand Down
2 changes: 1 addition & 1 deletion spacy/pipeline/morphologizer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class Morphologizer(Tagger):
DOCS: https://spacy.io/api/morphologizer#get_loss
"""
validate_examples(examples, "Morphologizer.get_loss")
loss_func = SequenceCategoricalCrossentropy(names=tuple(self.labels), normalize=False)
loss_func = LegacySequenceCategoricalCrossentropy(names=tuple(self.labels), normalize=False)
truths = []
for eg in examples:
eg_truths = []
Expand Down

0 comments on commit 8a1f153

Please sign in to comment.