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
485da722
Unverified
Commit
485da722
authored
Sep 02, 2020
by
Yohei Tamura
Committed by
GitHub
Sep 02, 2020
Browse files
fix error class instantiation (#6634)
parent
4230d30f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/transformers/tokenization_bert_japanese.py
src/transformers/tokenization_bert_japanese.py
+4
-4
No files found.
src/transformers/tokenization_bert_japanese.py
View file @
485da722
...
@@ -199,7 +199,7 @@ class MecabTokenizer:
...
@@ -199,7 +199,7 @@ class MecabTokenizer:
try
:
try
:
import
fugashi
import
fugashi
except
ModuleNotFoundError
as
error
:
except
ModuleNotFoundError
as
error
:
raise
error
(
raise
error
.
__class__
(
"You need to install fugashi to use MecabTokenizer."
"You need to install fugashi to use MecabTokenizer."
"See https://pypi.org/project/fugashi/ for installation."
"See https://pypi.org/project/fugashi/ for installation."
)
)
...
@@ -211,7 +211,7 @@ class MecabTokenizer:
...
@@ -211,7 +211,7 @@ class MecabTokenizer:
try
:
try
:
import
ipadic
import
ipadic
except
ModuleNotFoundError
as
error
:
except
ModuleNotFoundError
as
error
:
raise
error
(
raise
error
.
__class__
(
"The ipadic dictionary is not installed. "
"The ipadic dictionary is not installed. "
"See https://github.com/polm/ipadic-py for installation."
"See https://github.com/polm/ipadic-py for installation."
)
)
...
@@ -222,7 +222,7 @@ class MecabTokenizer:
...
@@ -222,7 +222,7 @@ class MecabTokenizer:
try
:
try
:
import
unidic_lite
import
unidic_lite
except
ModuleNotFoundError
as
error
:
except
ModuleNotFoundError
as
error
:
raise
error
(
raise
error
.
__class__
(
"The unidic_lite dictionary is not installed. "
"The unidic_lite dictionary is not installed. "
"See https://github.com/polm/unidic-lite for installation."
"See https://github.com/polm/unidic-lite for installation."
)
)
...
@@ -233,7 +233,7 @@ class MecabTokenizer:
...
@@ -233,7 +233,7 @@ class MecabTokenizer:
try
:
try
:
import
unidic
import
unidic
except
ModuleNotFoundError
as
error
:
except
ModuleNotFoundError
as
error
:
raise
error
(
raise
error
.
__class__
(
"The unidic dictionary is not installed. "
"The unidic dictionary is not installed. "
"See https://github.com/polm/unidic-py for installation."
"See https://github.com/polm/unidic-py for installation."
)
)
...
...
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