Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ab7551cd
Unverified
Commit
ab7551cd
authored
Aug 10, 2021
by
Kevin Canwen Xu
Committed by
GitHub
Aug 10, 2021
Browse files
Add try-except for torch_scatter (#13040)
* Add try-catch for torch_scatter * Update modeling_tapas.py
parent
76cadb79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/transformers/models/tapas/modeling_tapas.py
src/transformers/models/tapas/modeling_tapas.py
+10
-3
No files found.
src/transformers/models/tapas/modeling_tapas.py
View file @
ab7551cd
...
@@ -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
():
try
:
from
torch_scatter
import
scatter
from
torch_scatter
import
scatter
except
OSError
:
logger
=
logging
.
get_logger
(
__name__
)
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment