mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
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.
This commit is contained in:
parent
cd79c7bd26
commit
993758c58f
|
@ -757,8 +757,6 @@ class Language(object):
|
||||||
|
|
||||||
DOCS: https://spacy.io/api/language#pipe
|
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:
|
if is_python2 and n_process != 1:
|
||||||
user_warning(Warnings.W023)
|
user_warning(Warnings.W023)
|
||||||
n_process = 1
|
n_process = 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user