Skip to content

Commit 417f2b2

Browse files
authored
Merge pull request #361 from adrianeboyd/backport/ci-extend-transformers
Backport requirements and CI updates to v1.1.x
2 parents 58ffc8e + f067de7 commit 417f2b2

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

azure-pipelines.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
Python36Linux:
20-
imageName: 'ubuntu-latest'
20+
imageName: 'ubuntu-20.04'
2121
python.version: '3.6'
2222
Python37Mac:
2323
imageName: 'macos-latest'
@@ -34,6 +34,9 @@ jobs:
3434
Python310Windows:
3535
imageName: 'windows-latest'
3636
python.version: '3.10'
37+
Python311Linux:
38+
imageName: 'ubuntu-latest'
39+
python.version: '3.11'
3740
maxParallel: 4
3841
pool:
3942
vmImage: $(imageName)
@@ -67,11 +70,6 @@ jobs:
6770
displayName: 'Install oldest supported torch for python 3.6'
6871
condition: eq(variables['python.version'], '3.6')
6972
70-
- script: |
71-
pip install "torch<1.13.0+cpu" --extra-index-url https://download.pytorch.org/whl/cpu
72-
displayName: 'Install newest working torch for python 3.7+'
73-
condition: ne(variables['python.version'], '3.6')
74-
7573
- bash: |
7674
SDIST=$(python -c "import os;print(os.listdir('./dist')[0])" 2>&1)
7775
python -m pip install dist/$SDIST

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
spacy>=3.4.0,<4.0.0
2-
transformers>=3.4.0,<4.25.0
2+
transformers>=3.4.0,<4.26.0
33
torch>=1.6.0
44
srsly>=2.4.0,<3.0.0
55
dataclasses>=0.6,<1.0; python_version < "3.7"

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ classifiers =
2424
Programming Language :: Python :: 3.8
2525
Programming Language :: Python :: 3.9
2626
Programming Language :: Python :: 3.10
27+
Programming Language :: Python :: 3.11
2728

2829
[options]
2930
zip_safe = false
3031
include_package_data = true
3132
python_requires = >=3.6
3233
install_requires =
3334
spacy>=3.4.0,<4.0.0
34-
transformers>=3.4.0,<4.25.0
35+
transformers>=3.4.0,<4.26.0
3536
torch>=1.6.0
3637
srsly>=2.4.0,<3.0.0
3738
dataclasses>=0.6,<1.0; python_version < "3.7"

spacy_transformers/tests/test_serialize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ def test_transformer_pipeline_todisk_settings():
116116
assert trf.model.transformer.config.output_attentions is False
117117
assert "attentions" not in nlp("test")._.trf_data.model_output
118118
# modify model_max_length (note that modifications to
119-
# tokenizer.model_max_length are not serialized by save_pretrained
120-
# see: https://github.com/explosion/spaCy/discussions/7393)
119+
# tokenizer.model_max_length for transformers<4.25 are not serialized by
120+
# save_pretrained, see: https://github.com/explosion/spaCy/discussions/7393)
121121
trf.model.tokenizer.init_kwargs["model_max_length"] = 499
122+
# transformer>=4.25, model_max_length is saved and init_kwargs changes are
123+
# clobbered, so do both for this test
124+
trf.model.tokenizer.model_max_length = 499
122125
# add attentions on-the-fly
123126
trf.model.transformer.config.output_attentions = True
124127
assert nlp("test")._.trf_data.model_output.attentions is not None

0 commit comments

Comments
 (0)