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

Backport: make all the piece processors picklable (#53) #54

Merged

Conversation

danieldk
Copy link
Contributor

Description

Backport #53 to spaCy 3.x.

Types of change

Backport.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

* Make all the piece processors picklable

The piece processors are not pure Python classes, so could not be
pickled. Implement `__reduce__` on all the processors to make them
pickable.

This is one step in making spaCy multiprocessing work.

See: explosion/spaCy#13233

* Type signature fix.

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Pickling tests: check class

---------

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
@danieldk danieldk changed the title Make all the piece processors picklable (#53) Backport: make all the piece processors picklable (#53) Jan 17, 2024
@danieldk danieldk merged commit 79bba4a into explosion:spacy-3.x Jan 17, 2024
6 checks passed
@danieldk danieldk deleted the maintenance/backport-pickling branch January 17, 2024 13:29
danieldk added a commit to danieldk/curated-tokenizers that referenced this pull request Apr 11, 2024
* Make all the piece processors picklable

The piece processors are not pure Python classes, so could not be
pickled. Implement `__reduce__` on all the processors to make them
pickable.

This is one step in making spaCy multiprocessing work.

See: explosion/spaCy#13233

* Type signature fix.

* Pickling tests: check class

---------

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
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.

None yet

1 participant