mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-21 17:41:59 +03:00
Add error message to assertion
This commit is contained in:
parent
eb1db7b720
commit
725b83bba7
|
@ -2041,7 +2041,10 @@ class Language:
|
|||
num_params = len(
|
||||
inspect.signature(replace_listener_func).parameters
|
||||
)
|
||||
assert num_params in (1, 3)
|
||||
assert num_params in (
|
||||
1,
|
||||
3,
|
||||
), f"'replace_listener' callback expects {num_params} parameters, but we only support one or three"
|
||||
if num_params == 1:
|
||||
new_model = replace_listener_func(new_model)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user