mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Move cupy and CudaStream to compat
This commit is contained in:
parent
33decd85b6
commit
abf0188b0a
|
@ -16,6 +16,17 @@ try:
|
|||
except ImportError:
|
||||
import copyreg as copy_reg
|
||||
|
||||
try:
|
||||
from cupy.cuda.stream import Stream as CudaStream
|
||||
except ImportError:
|
||||
CudaStream = None
|
||||
|
||||
try:
|
||||
import cupy
|
||||
except ImportError:
|
||||
cupy = None
|
||||
|
||||
|
||||
pickle = pickle
|
||||
copy_reg = copy_reg
|
||||
CudaStream = CudaStream
|
||||
|
|
|
@ -10,20 +10,12 @@ import sys
|
|||
import textwrap
|
||||
|
||||
from .symbols import ORTH
|
||||
from .compat import path2str, basestring_, input_, unicode_
|
||||
from .compat import cupy, CudaStream, path2str, basestring_, input_, unicode_
|
||||
|
||||
|
||||
LANGUAGES = {}
|
||||
_data_path = Path(__file__).parent / 'data'
|
||||
try:
|
||||
from cupy.cuda.stream import Stream as CudaStream
|
||||
except ImportError:
|
||||
CudaStream = None
|
||||
|
||||
try:
|
||||
import cupy
|
||||
except ImportError:
|
||||
cupy = None
|
||||
|
||||
def get_lang_class(lang):
|
||||
"""Import and load a Language class.
|
||||
|
|
Loading…
Reference in New Issue
Block a user