mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-28 21:03:41 +03:00
Allow sourcing disabled components (#7215)
Check `component_names` instead of `pipe_names` to allow sourcing disabled components.
This commit is contained in:
parent
10c930cc96
commit
e43d43db32
|
@ -684,12 +684,12 @@ class Language:
|
||||||
# TODO: handle errors and mismatches (vectors etc.)
|
# TODO: handle errors and mismatches (vectors etc.)
|
||||||
if not isinstance(source, self.__class__):
|
if not isinstance(source, self.__class__):
|
||||||
raise ValueError(Errors.E945.format(name=source_name, source=type(source)))
|
raise ValueError(Errors.E945.format(name=source_name, source=type(source)))
|
||||||
if not source.has_pipe(source_name):
|
if not source_name in source.component_names:
|
||||||
raise KeyError(
|
raise KeyError(
|
||||||
Errors.E944.format(
|
Errors.E944.format(
|
||||||
name=source_name,
|
name=source_name,
|
||||||
model=f"{source.meta['lang']}_{source.meta['name']}",
|
model=f"{source.meta['lang']}_{source.meta['name']}",
|
||||||
opts=", ".join(source.pipe_names),
|
opts=", ".join(source.component_names),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
pipe = source.get_pipe(source_name)
|
pipe = source.get_pipe(source_name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user