mirror of
https://github.com/explosion/spaCy.git
synced 2025-10-25 13:11:03 +03:00
* Enable Cython<->Python bindings for `Pipe` and `TrainablePipe` methods * `pipes_with_nvtx_range`: Skip hooking methods whose signature cannot be ascertained When loading pipelines from a config file, the arguments passed to individual pipeline components is validated by `pydantic` during init. For this, the validation model attempts to parse the function signature of the component's c'tor/entry point so that it can check if all mandatory parameters are present in the config file. When using the `models_and_pipes_with_nvtx_range` as a `after_pipeline_creation` callback, the methods of all pipeline components get replaced by a NVTX range wrapper **before** the above-mentioned validation takes place. This can be problematic for components that are implemented as Cython extension types - if the extension type is not compiled with Python bindings for its methods, they will have no signatures at runtime. This resulted in `pydantic` matching the *wrapper's* parameters with the those in the config and raising errors. To avoid this, we now skip applying the wrapper to any (Cython) methods that do not have signatures. |
||
|---|---|---|
| .. | ||
| _edit_tree_internals | ||
| _parser_internals | ||
| legacy | ||
| __init__.py | ||
| attributeruler.py | ||
| dep_parser.pyx | ||
| edit_tree_lemmatizer.py | ||
| entity_linker.py | ||
| entityruler.py | ||
| functions.py | ||
| lemmatizer.py | ||
| morphologizer.pyx | ||
| multitask.pyx | ||
| ner.pyx | ||
| pipe.pxd | ||
| pipe.pyi | ||
| pipe.pyx | ||
| sentencizer.pyx | ||
| senter.pyx | ||
| span_ruler.py | ||
| spancat.py | ||
| tagger.pyx | ||
| textcat_multilabel.py | ||
| textcat.py | ||
| tok2vec.py | ||
| trainable_pipe.pxd | ||
| trainable_pipe.pyx | ||
| transition_parser.pxd | ||
| transition_parser.pyx | ||