mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-06 22:50:33 +03:00
Start errors/warnings at higher numbers to avoid merge conflicts
Between the master and v4 branches.
This commit is contained in:
parent
df513beddb
commit
5eeb2e8f90
|
@ -209,7 +209,7 @@ class Warnings(metaclass=ErrorsWithCodes):
|
||||||
"Only the last span group will be loaded under "
|
"Only the last span group will be loaded under "
|
||||||
"Doc.spans['{group_name}']. Skipping span group with values: "
|
"Doc.spans['{group_name}']. Skipping span group with values: "
|
||||||
"{group_values}")
|
"{group_values}")
|
||||||
W121 = ("Activation '{activation}' is unknown for pipe '{pipe_name}'")
|
W400 = ("Activation '{activation}' is unknown for pipe '{pipe_name}'")
|
||||||
|
|
||||||
|
|
||||||
class Errors(metaclass=ErrorsWithCodes):
|
class Errors(metaclass=ErrorsWithCodes):
|
||||||
|
@ -935,7 +935,7 @@ class Errors(metaclass=ErrorsWithCodes):
|
||||||
E1041 = ("Expected a string, Doc, or bytes as input, but got: {type}")
|
E1041 = ("Expected a string, Doc, or bytes as input, but got: {type}")
|
||||||
E1042 = ("Function was called with `{arg1}`={arg1_values} and "
|
E1042 = ("Function was called with `{arg1}`={arg1_values} and "
|
||||||
"`{arg2}`={arg2_values} but these arguments are conflicting.")
|
"`{arg2}`={arg2_values} but these arguments are conflicting.")
|
||||||
E1043 = ("store_activations attribute must be set to List[str] or bool")
|
E1400 = ("store_activations attribute must be set to List[str] or bool")
|
||||||
|
|
||||||
|
|
||||||
# Deprecated model shortcuts, only used in errors and warnings
|
# Deprecated model shortcuts, only used in errors and warnings
|
||||||
|
|
|
@ -361,11 +361,11 @@ cdef class TrainablePipe(Pipe):
|
||||||
if activation in known_activations:
|
if activation in known_activations:
|
||||||
self._store_activations.append(activation)
|
self._store_activations.append(activation)
|
||||||
else:
|
else:
|
||||||
warnings.warn(Warnings.W121.format(activation=activation, pipe_name=self.name))
|
warnings.warn(Warnings.W400.format(activation=activation, pipe_name=self.name))
|
||||||
elif isinstance(activations, bool):
|
elif isinstance(activations, bool):
|
||||||
if activations:
|
if activations:
|
||||||
self._store_activations = list(known_activations)
|
self._store_activations = list(known_activations)
|
||||||
else:
|
else:
|
||||||
self._store_activations = []
|
self._store_activations = []
|
||||||
else:
|
else:
|
||||||
raise ValueError(Errors.E1043)
|
raise ValueError(Errors.E1400)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user