mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix default parameters for load functions
Some load functions used SimpleFrozenList() directly instead of the _DEFAULT_EMPTY_PIPES parameter. That mostly worked as intended, but the changes in #11459 check for equality using identity, not value, so a warning is incorrectly raised sometimes, as in #11706. This change just has all the load functions use the singleton value instead.
This commit is contained in:
parent
6b78135b9e
commit
dc46b35687
|
@ -443,9 +443,9 @@ def load_model_from_package(
|
||||||
name: str,
|
name: str,
|
||||||
*,
|
*,
|
||||||
vocab: Union["Vocab", bool] = True,
|
vocab: Union["Vocab", bool] = True,
|
||||||
disable: Union[str, Iterable[str]] = SimpleFrozenList(),
|
disable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
enable: Union[str, Iterable[str]] = SimpleFrozenList(),
|
enable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
exclude: Union[str, Iterable[str]] = SimpleFrozenList(),
|
exclude: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
config: Union[Dict[str, Any], Config] = SimpleFrozenDict(),
|
config: Union[Dict[str, Any], Config] = SimpleFrozenDict(),
|
||||||
) -> "Language":
|
) -> "Language":
|
||||||
"""Load a model from an installed package.
|
"""Load a model from an installed package.
|
||||||
|
@ -619,9 +619,9 @@ def load_model_from_init_py(
|
||||||
init_file: Union[Path, str],
|
init_file: Union[Path, str],
|
||||||
*,
|
*,
|
||||||
vocab: Union["Vocab", bool] = True,
|
vocab: Union["Vocab", bool] = True,
|
||||||
disable: Union[str, Iterable[str]] = SimpleFrozenList(),
|
disable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
enable: Union[str, Iterable[str]] = SimpleFrozenList(),
|
enable: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
exclude: Union[str, Iterable[str]] = SimpleFrozenList(),
|
exclude: Union[str, Iterable[str]] = _DEFAULT_EMPTY_PIPES,
|
||||||
config: Union[Dict[str, Any], Config] = SimpleFrozenDict(),
|
config: Union[Dict[str, Any], Config] = 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user