mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 17:54:39 +03:00
Fix docs example [ci skip]
This commit is contained in:
parent
ba1e004049
commit
c968d1560f
|
@ -243,12 +243,12 @@ $ python -m spacy download en_core_web_trf
|
||||||
```python
|
```python
|
||||||
### Example
|
### Example
|
||||||
import spacy
|
import spacy
|
||||||
from thinc.api import use_pytorch_for_gpu_memory, require_gpu
|
from thinc.api import set_gpu_allocator, require_gpu
|
||||||
|
|
||||||
# Use the GPU, with memory allocations directed via PyTorch.
|
# Use the GPU, with memory allocations directed via PyTorch.
|
||||||
# This prevents out-of-memory errors that would otherwise occur from competing
|
# This prevents out-of-memory errors that would otherwise occur from competing
|
||||||
# memory pools.
|
# memory pools.
|
||||||
use_pytorch_for_gpu_memory()
|
set_gpu_allocator("pytorch")
|
||||||
require_gpu(0)
|
require_gpu(0)
|
||||||
|
|
||||||
nlp = spacy.load("en_core_web_trf")
|
nlp = spacy.load("en_core_web_trf")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user