mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 05:07:03 +03:00
commit
f090f39f17
|
@ -1361,11 +1361,12 @@ def check_bool_env_var(env_var: str) -> bool:
|
||||||
def _pipe(docs, proc, kwargs):
|
def _pipe(docs, proc, kwargs):
|
||||||
if hasattr(proc, "pipe"):
|
if hasattr(proc, "pipe"):
|
||||||
yield from proc.pipe(docs, **kwargs)
|
yield from proc.pipe(docs, **kwargs)
|
||||||
# We added some args for pipe that __call__ doesn't expect.
|
else:
|
||||||
kwargs = dict(kwargs)
|
# We added some args for pipe that __call__ doesn't expect.
|
||||||
for arg in ["batch_size"]:
|
kwargs = dict(kwargs)
|
||||||
if arg in kwargs:
|
for arg in ["batch_size"]:
|
||||||
kwargs.pop(arg)
|
if arg in kwargs:
|
||||||
for doc in docs:
|
kwargs.pop(arg)
|
||||||
doc = proc(doc, **kwargs)
|
for doc in docs:
|
||||||
yield doc
|
doc = proc(doc, **kwargs)
|
||||||
|
yield doc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user