mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
add pipe_instances also to load_model_from_init_py
This commit is contained in:
parent
4cc5bd3ef5
commit
9fcbc8eb67
|
@ -675,6 +675,7 @@ def load_model_from_init_py(
|
||||||
enable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
enable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
exclude: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
exclude: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
config: Union[Dict[str, Any], Config] = SimpleFrozenDict(),
|
config: Union[Dict[str, Any], Config] = SimpleFrozenDict(),
|
||||||
|
pipe_instances: Dict[str, Any] = SimpleFrozenDict(),
|
||||||
) -> "Language":
|
) -> "Language":
|
||||||
"""Helper function to use in the `load()` method of a model package's
|
"""Helper function to use in the `load()` method of a model package's
|
||||||
__init__.py.
|
__init__.py.
|
||||||
|
@ -690,6 +691,9 @@ def load_model_from_init_py(
|
||||||
components won't be loaded.
|
components won't be loaded.
|
||||||
config (Dict[str, Any] / Config): Config overrides as nested dict or dict
|
config (Dict[str, Any] / Config): Config overrides as nested dict or dict
|
||||||
keyed by section values in dot notation.
|
keyed by section values in dot notation.
|
||||||
|
pipe_instances (Dict[str, Any]): Dictionary of components
|
||||||
|
to be added to the pipeline directly (not created from
|
||||||
|
config)
|
||||||
RETURNS (Language): The loaded nlp object.
|
RETURNS (Language): The loaded nlp object.
|
||||||
"""
|
"""
|
||||||
model_path = Path(init_file).parent
|
model_path = Path(init_file).parent
|
||||||
|
|
Loading…
Reference in New Issue
Block a user