mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
hook up meta in load_model_from_config (#10400)
This commit is contained in:
parent
91acc3ea75
commit
d89dac4066
|
@ -485,13 +485,16 @@ def load_model_from_path(
|
||||||
config_path = model_path / "config.cfg"
|
config_path = model_path / "config.cfg"
|
||||||
overrides = dict_to_dot(config)
|
overrides = dict_to_dot(config)
|
||||||
config = load_config(config_path, overrides=overrides)
|
config = load_config(config_path, overrides=overrides)
|
||||||
nlp = load_model_from_config(config, vocab=vocab, disable=disable, exclude=exclude)
|
nlp = load_model_from_config(
|
||||||
|
config, vocab=vocab, disable=disable, exclude=exclude, meta=meta
|
||||||
|
)
|
||||||
return nlp.from_disk(model_path, exclude=exclude, overrides=overrides)
|
return nlp.from_disk(model_path, exclude=exclude, overrides=overrides)
|
||||||
|
|
||||||
|
|
||||||
def load_model_from_config(
|
def load_model_from_config(
|
||||||
config: Union[Dict[str, Any], Config],
|
config: Union[Dict[str, Any], Config],
|
||||||
*,
|
*,
|
||||||
|
meta: Dict[str, Any] = SimpleFrozenDict(),
|
||||||
vocab: Union["Vocab", bool] = True,
|
vocab: Union["Vocab", bool] = True,
|
||||||
disable: Iterable[str] = SimpleFrozenList(),
|
disable: Iterable[str] = SimpleFrozenList(),
|
||||||
exclude: Iterable[str] = SimpleFrozenList(),
|
exclude: Iterable[str] = SimpleFrozenList(),
|
||||||
|
@ -529,6 +532,7 @@ def load_model_from_config(
|
||||||
exclude=exclude,
|
exclude=exclude,
|
||||||
auto_fill=auto_fill,
|
auto_fill=auto_fill,
|
||||||
validate=validate,
|
validate=validate,
|
||||||
|
meta=meta,
|
||||||
)
|
)
|
||||||
return nlp
|
return nlp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user