Add check for remove_listener method

This commit is contained in:
Ines Montani 2021-01-29 23:47:30 +11:00
parent 7694f76dd1
commit 7886d59c56
1 changed files with 1 additions and 0 deletions

View File

@ -1732,6 +1732,7 @@ class Language:
if ( if (
not hasattr(tok2vec, "model") not hasattr(tok2vec, "model")
or not hasattr(tok2vec, "listener_map") or not hasattr(tok2vec, "listener_map")
or not hasattr(tok2vec, "remove_listener")
or "model" not in tok2vec_cfg or "model" not in tok2vec_cfg
): ):
raise ValueError(Errors.E888.format(name=tok2vec_name, pipe=type(tok2vec))) raise ValueError(Errors.E888.format(name=tok2vec_name, pipe=type(tok2vec)))