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
0f69b924
Unverified
Commit
0f69b924
authored
Jan 30, 2022
by
Suraj Patil
Committed by
GitHub
Jan 30, 2022
Browse files
[XGLMTokenizer] fix init and add in AutoTokenizer (#15406)
parent
f380bf2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
src/transformers/models/auto/tokenization_auto.py
src/transformers/models/auto/tokenization_auto.py
+7
-0
src/transformers/models/xglm/__init__.py
src/transformers/models/xglm/__init__.py
+13
-3
No files found.
src/transformers/models/auto/tokenization_auto.py
View file @
0f69b924
...
...
@@ -225,6 +225,13 @@ else:
None
,
),
),
(
"xglm"
,
(
"XGLMTokenizer"
if
is_sentencepiece_available
()
else
None
,
"XGLMTokenizerFast"
if
is_tokenizers_available
()
else
None
,
),
),
]
)
...
...
src/transformers/models/xglm/__init__.py
View file @
0f69b924
...
...
@@ -18,14 +18,22 @@
from
typing
import
TYPE_CHECKING
# rely on isort to merge the imports
from
...file_utils
import
_LazyModule
,
is_flax_available
,
is_tokenizers_available
,
is_torch_available
from
...file_utils
import
(
_LazyModule
,
is_flax_available
,
is_sentencepiece_available
,
is_tokenizers_available
,
is_torch_available
,
)
_import_structure
=
{
"configuration_xglm"
:
[
"XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP"
,
"XGLMConfig"
],
"tokenization_xglm"
:
[
"XGLMTokenizer"
],
}
if
is_sentencepiece_available
():
_import_structure
[
"tokenization_xglm"
]
=
[
"XGLMTokenizer"
]
if
is_tokenizers_available
():
_import_structure
[
"tokenization_xglm_fast"
]
=
[
"XGLMTokenizerFast"
]
...
...
@@ -48,7 +56,9 @@ if is_flax_available():
if
TYPE_CHECKING
:
from
.configuration_xglm
import
XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP
,
XGLMConfig
from
.tokenization_xglm
import
XGLMTokenizer
if
is_sentencepiece_available
():
from
.tokenization_xglm
import
XGLMTokenizer
if
is_tokenizers_available
():
from
.tokenization_xglm_fast
import
XGLMTokenizerFast
...
...
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