Skip to content

Commit 7c6a975

Browse files
committed
Simplify GPU check
This change removes `thinc.util.has_cupy` from the GPU presence check. Currently `gpu_is_available` already implies `has_cupy`. We also want to show this warning in the future when a machine has a non-CuPy GPU.
1 parent f6a4b80 commit 7c6a975

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spacy/cli/_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from typer.main import get_command
1313
from contextlib import contextmanager
1414
from thinc.api import Config, ConfigValidationError, require_gpu
15-
from thinc.util import has_cupy, gpu_is_available
15+
from thinc.util import gpu_is_available
1616
from configparser import InterpolationError
1717
import os
1818

@@ -554,5 +554,5 @@ def setup_gpu(use_gpu: int, silent=None) -> None:
554554
require_gpu(use_gpu)
555555
else:
556556
local_msg.info("Using CPU")
557-
if has_cupy and gpu_is_available():
557+
if gpu_is_available():
558558
local_msg.info("To switch to GPU 0, use the option: --gpu-id 0")

0 commit comments

Comments
 (0)