Add multi-threading note to Language.pipe (resolves #2582) [ci skip]

This commit is contained in:
Ines Montani 2018-09-12 15:03:30 +02:00
parent 885691a7ab
commit 907df53904

View File

@ -99,6 +99,12 @@ p
| Process texts as a stream, and yield #[code Doc] objects in order. | Process texts as a stream, and yield #[code Doc] objects in order.
| Supports GIL-free multi-threading. | Supports GIL-free multi-threading.
+infobox("⚠️", "Important note for spaCy v2.0.x")
| By default, multiple threads will be launched for matrix multiplication,
| which may be inefficient on multi-core machines. Setting
| #[code OPENBLAS_NUM_THREADS=1] should fix this problem. spaCy v2.1.x
| will be switching to single-thread by default.
+aside-code("Example"). +aside-code("Example").
texts = [u'One document.', u'...', u'Lots of documents'] texts = [u'One document.', u'...', u'Lots of documents']
for doc in nlp.pipe(texts, batch_size=50, n_threads=4): for doc in nlp.pipe(texts, batch_size=50, n_threads=4):