diff --git a/spacy/ml/models/tok2vec.py b/spacy/ml/models/tok2vec.py index 881fcce67..35cc10bd5 100644 --- a/spacy/ml/models/tok2vec.py +++ b/spacy/ml/models/tok2vec.py @@ -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") diff --git a/spacy/util.py b/spacy/util.py index 6b35ab4ec..0373e2219 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -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