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
from .configuration_tapas import TapasConfig
logger = logging.get_logger(__name__)
# soft dependency
if is_scatter_available():
from torch_scatter import scatter
logger = logging.get_logger(__name__)
try:
from torch_scatter import scatter
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"
_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