mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
Fix check of unexpected pipe names in restore()
This commit is contained in:
parent
7f03932477
commit
6a00de4f77
|
@ -700,7 +700,7 @@ class DisabledPipes(list):
|
|||
def restore(self):
|
||||
'''Restore the pipeline to its state when DisabledPipes was created.'''
|
||||
current, self.nlp.pipeline = self.nlp.pipeline, self.original_pipeline
|
||||
unexpected = [name for name in current if not self.nlp.has_pipe(name)]
|
||||
unexpected = [name for name, pipe in current if not self.nlp.has_pipe(name)]
|
||||
if unexpected:
|
||||
# Don't change the pipeline if we're raising an error.
|
||||
self.nlp.pipeline = current
|
||||
|
|
Loading…
Reference in New Issue
Block a user