"examples/git@developer.sourcefind.cn:OpenDAS/fastmoe.git" did not exist on "61e4533fd7464b643601b74a154b883aaf102933"
Unverified Commit ab7551cd authored by Kevin Canwen Xu's avatar Kevin Canwen Xu Committed by GitHub
Browse files

Add try-except for torch_scatter (#13040)

* Add try-catch for torch_scatter

* Update modeling_tapas.py
parent 76cadb79
...@@ -46,11 +46,18 @@ from ...utils import logging ...@@ -46,11 +46,18 @@ from ...utils import logging
from .configuration_tapas import TapasConfig from .configuration_tapas import TapasConfig
logger = logging.get_logger(__name__)
# soft dependency # soft dependency
if is_scatter_available(): if is_scatter_available():
from torch_scatter import scatter try:
from torch_scatter import scatter
logger = logging.get_logger(__name__) except OSError:
logger.error(
"TAPAS models are not usable since `torch_scatter` can't be loaded."
"It seems you have `torch_scatter` installed with the wrong CUDA version."
"Please try to reinstall it following the instructions here: https://github.com/rusty1s/pytorch_scatter."
)
_CONFIG_FOR_DOC = "TapasConfig" _CONFIG_FOR_DOC = "TapasConfig"
_TOKENIZER_FOR_DOC = "TapasTokenizer" _TOKENIZER_FOR_DOC = "TapasTokenizer"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment