Unverified Commit 0f69b924 authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

[XGLMTokenizer] fix init and add in AutoTokenizer (#15406)

parent f380bf2b
......@@ -225,6 +225,13 @@ else:
None,
),
),
(
"xglm",
(
"XGLMTokenizer" if is_sentencepiece_available() else None,
"XGLMTokenizerFast" if is_tokenizers_available() else None,
),
),
]
)
......
......@@ -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,6 +56,8 @@ if is_flax_available():
if TYPE_CHECKING:
from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig
if is_sentencepiece_available():
from .tokenization_xglm import XGLMTokenizer
if is_tokenizers_available():
......
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