From 993758c58fba9d4611223f5dd6dcdb203cf67bba Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Sun, 8 Mar 2020 13:22:25 +0100 Subject: [PATCH] Remove unnecessary iterator in Language.pipe (#5101) Remove iterator over `raw_texts` with `iterator.tee()` in `Language.pipe` that is never consumed and consumes memory unnecessarily. --- spacy/language.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index 28fddfebb..f0928b1f9 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -757,8 +757,6 @@ class Language(object): DOCS: https://spacy.io/api/language#pipe """ - # raw_texts will be used later to stop iterator. - texts, raw_texts = itertools.tee(texts) if is_python2 and n_process != 1: user_warning(Warnings.W023) n_process = 1