Fix resolve_dot_names

This commit is contained in:
Ines Montani 2020-09-28 15:27:10 +02:00
parent 822ea4ef61
commit 02838a1d47
1 changed files with 2 additions and 5 deletions

View File

@ -379,9 +379,7 @@ def load_model_from_config(
return nlp
def resolve_dot_names(
config: Config, dot_names: List[Optional[str]]
) -> Tuple[Any]:
def resolve_dot_names(config: Config, dot_names: List[Optional[str]]) -> Tuple[Any]:
"""Resolve one or more "dot notation" names, e.g. corpora.train.
The paths could point anywhere into the config, so we don't know which
top-level section we'll be looking within.
@ -410,8 +408,7 @@ def resolve_dot_names(
objects = []
for ref in output:
if not isinstance(ref, str):
msg = f"not a valid section reference: {ref} ({type(ref)})"
errors.append({"loc": ref.split("."), "msg": msg})
objects.append(ref)
continue
section = ref.split(".")[0]
# We want to avoid resolving the same thing twice