Skip to content

Commit 030d63a

Browse files
authored
Merge pull request #13045 from explosion/master
Sync `docs/llm_main` with `master`
2 parents 1162fcf + be29216 commit 030d63a

File tree

101 files changed

+1785
-2257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1785
-2257
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ jobs:
5858
fail-fast: true
5959
matrix:
6060
os: [ubuntu-latest, windows-latest, macos-latest]
61-
python_version: ["3.11"]
61+
python_version: ["3.11", "3.12.0-rc.2"]
6262
include:
63-
- os: ubuntu-20.04
64-
python_version: "3.6"
6563
- os: windows-latest
6664
python_version: "3.7"
6765
- os: macos-latest
@@ -95,7 +93,7 @@ jobs:
9593
- name: Run mypy
9694
run: |
9795
python -m mypy spacy
98-
if: matrix.python_version != '3.6'
96+
if: matrix.python_version != '3.7'
9997

10098
- name: Delete source directory and .egg-info
10199
run: |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ model packaging, deployment and workflow management. spaCy is commercial
1616
open-source software, released under the
1717
[MIT license](https://github.com/explosion/spaCy/blob/master/LICENSE).
1818

19-
💫 **Version 3.6 out now!**
19+
💫 **Version 3.7 out now!**
2020
[Check out the release notes here.](https://github.com/explosion/spaCy/releases)
2121

2222
[![tests](https://github.com/explosion/spaCy/actions/workflows/tests.yml/badge.svg)](https://github.com/explosion/spaCy/actions/workflows/tests.yml)
@@ -108,7 +108,7 @@ For detailed installation instructions, see the
108108

109109
- **Operating system**: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual
110110
Studio)
111-
- **Python version**: Python 3.6+ (only 64 bit)
111+
- **Python version**: Python 3.7+ (only 64 bit)
112112
- **Package managers**: [pip] · [conda] (via `conda-forge`)
113113

114114
[pip]: https://pypi.org/project/spacy/

build-constraints.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# build version constraints for use with wheelwright + multibuild
2-
numpy==1.15.0; python_version<='3.7' and platform_machine!='aarch64'
3-
numpy==1.19.2; python_version<='3.7' and platform_machine=='aarch64'
1+
# build version constraints for use with wheelwright
2+
numpy==1.15.0; python_version=='3.7' and platform_machine!='aarch64'
3+
numpy==1.19.2; python_version=='3.7' and platform_machine=='aarch64'
44
numpy==1.17.3; python_version=='3.8' and platform_machine!='aarch64'
55
numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64'
6-
numpy==1.19.3; python_version=='3.9'
7-
numpy==1.21.3; python_version=='3.10'
8-
numpy==1.23.2; python_version=='3.11'
9-
numpy; python_version>='3.12'
6+
numpy>=1.25.0; python_version>='3.9'

extra/DEVELOPER_DOCS/Listeners.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Listeners
22

3-
1. [Overview](#1-overview)
4-
2. [Initialization](#2-initialization)
5-
- [A. Linking listeners to the embedding component](#2a-linking-listeners-to-the-embedding-component)
6-
- [B. Shape inference](#2b-shape-inference)
7-
3. [Internal communication](#3-internal-communication)
8-
- [A. During prediction](#3a-during-prediction)
9-
- [B. During training](#3b-during-training)
10-
- [C. Frozen components](#3c-frozen-components)
11-
4. [Replacing listener with standalone](#4-replacing-listener-with-standalone)
3+
- [1. Overview](#1-overview)
4+
- [2. Initialization](#2-initialization)
5+
- [2A. Linking listeners to the embedding component](#2a-linking-listeners-to-the-embedding-component)
6+
- [2B. Shape inference](#2b-shape-inference)
7+
- [3. Internal communication](#3-internal-communication)
8+
- [3A. During prediction](#3a-during-prediction)
9+
- [3B. During training](#3b-during-training)
10+
- [Training with multiple listeners](#training-with-multiple-listeners)
11+
- [3C. Frozen components](#3c-frozen-components)
12+
- [The Tok2Vec or Transformer is frozen](#the-tok2vec-or-transformer-is-frozen)
13+
- [The upstream component is frozen](#the-upstream-component-is-frozen)
14+
- [4. Replacing listener with standalone](#4-replacing-listener-with-standalone)
1215

1316
## 1. Overview
1417

@@ -62,7 +65,7 @@ of this `find_listener()` method will specifically identify sublayers of a model
6265

6366
If it's a Transformer-based pipeline, a
6467
[`transformer` component](https://github.com/explosion/spacy-transformers/blob/master/spacy_transformers/pipeline_component.py)
65-
has a similar implementation but its `find_listener()` function will specifically look for `TransformerListener`
68+
has a similar implementation but its `find_listener()` function will specifically look for `TransformerListener`
6669
sublayers of downstream components.
6770

6871
### 2B. Shape inference
@@ -154,7 +157,7 @@ as a tagger or a parser. This used to be impossible before 3.1, but has become s
154157
embedding component in the [`annotating_components`](https://spacy.io/usage/training#annotating-components)
155158
list of the config. This works like any other "annotating component" because it relies on the `Doc` attributes.
156159

157-
However, if the `Tok2Vec` or `Transformer` is frozen, and not present in `annotating_components`, and a related
160+
However, if the `Tok2Vec` or `Transformer` is frozen, and not present in `annotating_components`, and a related
158161
listener isn't frozen, then a `W086` warning is shown and further training of the pipeline will likely end with `E954`.
159162

160163
#### The upstream component is frozen
@@ -216,5 +219,17 @@ new_model = tok2vec_model.attrs["replace_listener"](new_model)
216219
```
217220

218221
The new config and model are then properly stored on the `nlp` object.
219-
Note that this functionality (running the replacement for a transformer listener) was broken prior to
222+
Note that this functionality (running the replacement for a transformer listener) was broken prior to
220223
`spacy-transformers` 1.0.5.
224+
225+
In spaCy 3.7, `Language.replace_listeners` was updated to pass the following additional arguments to the `replace_listener` callback:
226+
the listener to be replaced and the `tok2vec`/`transformer` pipe from which the new model was copied. To maintain backwards-compatiblity,
227+
the method only passes these extra arguments for callbacks that support them:
228+
229+
```
230+
def replace_listener_pre_37(copied_tok2vec_model):
231+
...
232+
233+
def replace_listener_post_37(copied_tok2vec_model, replaced_listener, tok2vec_pipe):
234+
...
235+
```

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ requires = [
55
"cymem>=2.0.2,<2.1.0",
66
"preshed>=3.0.2,<3.1.0",
77
"murmurhash>=0.28.0,<1.1.0",
8-
"thinc>=8.1.8,<8.2.0",
9-
"numpy>=1.15.0",
8+
"thinc>=8.1.8,<8.3.0",
9+
"numpy>=1.15.0; python_version < '3.9'",
10+
"numpy>=1.25.0; python_version >= '3.9'",
1011
]
1112
build-backend = "setuptools.build_meta"
1213

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ spacy-legacy>=3.0.11,<3.1.0
33
spacy-loggers>=1.0.0,<2.0.0
44
cymem>=2.0.2,<2.1.0
55
preshed>=3.0.2,<3.1.0
6-
thinc>=8.1.8,<8.2.0
6+
thinc>=8.1.8,<8.3.0
77
ml_datasets>=0.2.0,<0.3.0
88
murmurhash>=0.28.0,<1.1.0
99
wasabi>=0.9.1,<1.2.0
1010
srsly>=2.4.3,<3.0.0
1111
catalogue>=2.0.6,<2.1.0
1212
typer>=0.3.0,<0.10.0
13-
pathy>=0.10.0
1413
smart-open>=5.2.1,<7.0.0
14+
weasel>=0.1.0,<0.4.0
1515
# Third party dependencies
16-
numpy>=1.15.0
16+
numpy>=1.15.0; python_version < "3.9"
17+
numpy>=1.19.0; python_version >= "3.9"
1718
requests>=2.13.0,<3.0.0
1819
tqdm>=4.38.0,<5.0.0
1920
pydantic>=1.7.4,!=1.8,!=1.8.1,<3.0.0
@@ -31,12 +32,11 @@ pytest-timeout>=1.3.0,<2.0.0
3132
mock>=2.0.0,<3.0.0
3233
flake8>=3.8.0,<6.0.0
3334
hypothesis>=3.27.0,<7.0.0
34-
mypy>=0.990,<1.1.0; platform_machine != "aarch64" and python_version >= "3.7"
35-
types-dataclasses>=0.1.3; python_version < "3.7"
35+
mypy>=1.5.0,<1.6.0; platform_machine != "aarch64" and python_version >= "3.8"
3636
types-mock>=0.1.1
3737
types-setuptools>=57.0.0
3838
types-requests
3939
types-setuptools>=57.0.0
4040
black==22.3.0
41-
cython-lint>=0.15.0; python_version >= "3.7"
41+
cython-lint>=0.15.0
4242
isort>=5.0,<6.0

setup.cfg

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ classifiers =
1717
Operating System :: Microsoft :: Windows
1818
Programming Language :: Cython
1919
Programming Language :: Python :: 3
20-
Programming Language :: Python :: 3.6
2120
Programming Language :: Python :: 3.7
2221
Programming Language :: Python :: 3.8
2322
Programming Language :: Python :: 3.9
@@ -31,32 +30,36 @@ project_urls =
3130
[options]
3231
zip_safe = false
3332
include_package_data = true
34-
python_requires = >=3.6
33+
python_requires = >=3.7
34+
# NOTE: This section is superseded by pyproject.toml and will be removed in
35+
# spaCy v4
3536
setup_requires =
3637
cython>=0.25,<3.0
37-
numpy>=1.15.0
38+
numpy>=1.15.0; python_version < "3.9"
39+
numpy>=1.19.0; python_version >= "3.9"
3840
# We also need our Cython packages here to compile against
3941
cymem>=2.0.2,<2.1.0
4042
preshed>=3.0.2,<3.1.0
4143
murmurhash>=0.28.0,<1.1.0
42-
thinc>=8.1.8,<8.2.0
44+
thinc>=8.1.8,<8.3.0
4345
install_requires =
4446
# Our libraries
4547
spacy-legacy>=3.0.11,<3.1.0
4648
spacy-loggers>=1.0.0,<2.0.0
4749
murmurhash>=0.28.0,<1.1.0
4850
cymem>=2.0.2,<2.1.0
4951
preshed>=3.0.2,<3.1.0
50-
thinc>=8.1.8,<8.2.0
52+
thinc>=8.1.8,<8.3.0
5153
wasabi>=0.9.1,<1.2.0
5254
srsly>=2.4.3,<3.0.0
5355
catalogue>=2.0.6,<2.1.0
56+
weasel>=0.1.0,<0.4.0
5457
# Third-party dependencies
5558
typer>=0.3.0,<0.10.0
56-
pathy>=0.10.0
5759
smart-open>=5.2.1,<7.0.0
5860
tqdm>=4.38.0,<5.0.0
59-
numpy>=1.15.0
61+
numpy>=1.15.0; python_version < "3.9"
62+
numpy>=1.19.0; python_version >= "3.9"
6063
requests>=2.13.0,<3.0.0
6164
pydantic>=1.7.4,!=1.8,!=1.8.1,<3.0.0
6265
jinja2
@@ -74,9 +77,7 @@ console_scripts =
7477
lookups =
7578
spacy_lookups_data>=1.0.3,<1.1.0
7679
transformers =
77-
spacy_transformers>=1.1.2,<1.3.0
78-
ray =
79-
spacy_ray>=0.1.0,<1.0.0
80+
spacy_transformers>=1.1.2,<1.4.0
8081
cuda =
8182
cupy>=5.0.0b4,<13.0.0
8283
cuda80 =

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"language_level": -3,
7979
"embedsignature": True,
8080
"annotation_typing": False,
81+
"profile": sys.version_info < (3, 12),
8182
}
8283
# Files to copy into the package that are otherwise not included
8384
COPY_FILES = {

spacy/about.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# fmt: off
22
__title__ = "spacy"
3-
__version__ = "3.6.1"
3+
__version__ = "3.7.1"
44
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
55
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
6-
__projects__ = "https://github.com/explosion/projects"
7-
__projects_branch__ = "v3"

spacy/attrs.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# cython: profile=False
12
from .errors import Errors
23

34
IOB_STRINGS = ("", "I", "O", "B")

0 commit comments

Comments
 (0)