Don't raise in Pipe.initialize if not implemented

This commit is contained in:
Ines Montani 2020-09-30 00:05:27 +02:00
parent 7d04ba20c0
commit b799af16de
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ cdef class Pipe:
@property @property
def labels(self) -> Optional[Tuple[str]]: def labels(self) -> Optional[Tuple[str]]:
return [] return []
@property @property
def label_data(self): def label_data(self):
"""Optional JSON-serializable data that would be sufficient to recreate """Optional JSON-serializable data that would be sufficient to recreate
@ -207,7 +207,7 @@ cdef class Pipe:
DOCS: https://nightly.spacy.io/api/pipe#initialize DOCS: https://nightly.spacy.io/api/pipe#initialize
""" """
raise NotImplementedError(Errors.E931.format(method="initialize", name=self.name)) pass
def _ensure_examples(self, get_examples): def _ensure_examples(self, get_examples):
if get_examples is None or not hasattr(get_examples, "__call__"): if get_examples is None or not hasattr(get_examples, "__call__"):