Merge upstream master into PR branch

This commit is contained in:
richardpaulhudson 2022-12-12 11:16:19 +01:00
parent 953b6908d6
commit 0f20918008
2 changed files with 9 additions and 9 deletions

View File

@ -198,22 +198,22 @@ def _verify_rich_config_group(
) -> None:
if lengths is not None or rows is not None:
if is_search_char_group and (search_chars is None or len(search_chars) == 0):
raise ValueError(Errors.E1047.format(label=label))
if search_chars is not None and len(search_chars) > 63:
raise ValueError(Errors.E1048.format(label=label))
if search_chars is not None and len(search_chars) > 63:
raise ValueError(Errors.E1049.format(label=label))
if lengths is None or rows is None:
raise ValueError(Errors.E1047.format(label=label))
raise ValueError(Errors.E1048.format(label=label))
if len(lengths) != len(rows):
raise ValueError(Errors.E1047.format(label=label))
raise ValueError(Errors.E1048.format(label=label))
if any([length < 1 for length in lengths]):
raise ValueError(Errors.E1047.format(label=label))
raise ValueError(Errors.E1048.format(label=label))
elif search_chars is not None:
raise ValueError(Errors.E1047.format(label=label))
raise ValueError(Errors.E1048.format(label=label))
if lengths is not None:
if lengths[-1] > 63:
raise ValueError(Errors.E1048.format(label=label))
if len(lengths) != len(set(lengths)) or lengths != sorted(lengths):
raise ValueError(Errors.E1049.format(label=label))
if len(lengths) != len(set(lengths)) or lengths != sorted(lengths):
raise ValueError(Errors.E1050.format(label=label))
@registry.architectures("spacy.RichMultiHashEmbed.v1")

View File

@ -1768,7 +1768,7 @@ def get_search_char_byte_arrays(
):
this_width = idx - working_start
if this_width > 4 or this_width < working_width:
raise RuntimeError(Errors.E1050)
raise RuntimeError(Errors.E1051)
if this_width > working_width:
for i in range(working_width, 5):
width_offsets[i] = working_start