From 7886d59c5650f4d8abe1e97d78300c707053f8c8 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 29 Jan 2021 23:47:30 +1100 Subject: [PATCH] Add check for remove_listener method --- spacy/language.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/language.py b/spacy/language.py index 3c7f91dd6..eca311e8f 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1732,6 +1732,7 @@ class Language: if ( not hasattr(tok2vec, "model") or not hasattr(tok2vec, "listener_map") + or not hasattr(tok2vec, "remove_listener") or "model" not in tok2vec_cfg ): raise ValueError(Errors.E888.format(name=tok2vec_name, pipe=type(tok2vec)))