Use thinc.util.has_torch

This commit is contained in:
Paul O'Leary McCann 2022-05-24 16:02:39 +09:00
parent b1118cee58
commit 5cbc9f4573

View File

@ -7,10 +7,8 @@ from .textcat import * # noqa
from .tok2vec import * # noqa from .tok2vec import * # noqa
# some models require Torch # some models require Torch
try: from thinc.util import has_torch
import torch if has_torch:
from .coref import * #noqa from .coref import * #noqa
from .span_predictor import * #noqa from .span_predictor import * #noqa
except ImportError:
pass