mirror of
https://github.com/explosion/spaCy.git
synced 2025-10-20 10:44:41 +03:00
Torch is required for the coref/spanpred models but shouldn't be required for spaCy in general. The one tricky part of this is that one function in coref_util relied on torch, but that file was imported in several places. Since the function was only used in one place I moved it there.
17 lines
376 B
Python
17 lines
376 B
Python
from .entity_linker import * # noqa
|
|
from .multi_task import * # noqa
|
|
from .parser import * # noqa
|
|
from .spancat import * # noqa
|
|
from .tagger import * # noqa
|
|
from .textcat import * # noqa
|
|
from .tok2vec import * # noqa
|
|
|
|
# some models require Torch
|
|
try:
|
|
import torch
|
|
from .coref import * #noqa
|
|
from .span_predictor import * #noqa
|
|
except ImportError:
|
|
pass
|
|
|