Init pickle (#12567)
* Try to pickle transformers * Deal with special objs better * Make picklable
This commit is contained in:
@@ -51,4 +51,4 @@ Special Properties
|
|||||||
Other Utilities
|
Other Utilities
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. autoclass:: transformers.file_utils._BaseLazyModule
|
.. autoclass:: transformers.file_utils._LazyModule
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ from typing import TYPE_CHECKING
|
|||||||
# Check the dependencies satisfy the minimal versions required.
|
# Check the dependencies satisfy the minimal versions required.
|
||||||
from . import dependency_versions_check
|
from . import dependency_versions_check
|
||||||
from .file_utils import (
|
from .file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_flax_available,
|
is_flax_available,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_speech_available,
|
is_speech_available,
|
||||||
@@ -3058,28 +3058,11 @@ if TYPE_CHECKING:
|
|||||||
from .utils.dummy_flax_objects import *
|
from .utils.dummy_flax_objects import *
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(
|
||||||
"""
|
__name__, globals()["__file__"], _import_structure, extra_objects={"__version__": __version__}
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
def __getattr__(self, name: str):
|
|
||||||
# Special handling for the version, which is a constant from this module and not imported in a submodule.
|
|
||||||
if name == "__version__":
|
|
||||||
return __version__
|
|
||||||
return super().__getattr__(name)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|
||||||
|
|
||||||
if not is_tf_available() and not is_torch_available() and not is_flax_available():
|
if not is_tf_available() and not is_torch_available() and not is_flax_available():
|
||||||
|
|||||||
@@ -1865,14 +1865,14 @@ class TensorType(ExplicitEnum):
|
|||||||
JAX = "jax"
|
JAX = "jax"
|
||||||
|
|
||||||
|
|
||||||
class _BaseLazyModule(ModuleType):
|
class _LazyModule(ModuleType):
|
||||||
"""
|
"""
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Very heavily inspired by optuna.integration._IntegrationModule
|
# Very heavily inspired by optuna.integration._IntegrationModule
|
||||||
# https://github.com/optuna/optuna/blob/master/optuna/integration/__init__.py
|
# https://github.com/optuna/optuna/blob/master/optuna/integration/__init__.py
|
||||||
def __init__(self, name, import_structure):
|
def __init__(self, name, module_file, import_structure, extra_objects=None):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
self._modules = set(import_structure.keys())
|
self._modules = set(import_structure.keys())
|
||||||
self._class_to_module = {}
|
self._class_to_module = {}
|
||||||
@@ -1881,12 +1881,19 @@ class _BaseLazyModule(ModuleType):
|
|||||||
self._class_to_module[value] = key
|
self._class_to_module[value] = key
|
||||||
# Needed for autocompletion in an IDE
|
# Needed for autocompletion in an IDE
|
||||||
self.__all__ = list(import_structure.keys()) + sum(import_structure.values(), [])
|
self.__all__ = list(import_structure.keys()) + sum(import_structure.values(), [])
|
||||||
|
self.__file__ = module_file
|
||||||
|
self.__path__ = [os.path.dirname(module_file)]
|
||||||
|
self._objects = {} if extra_objects is None else extra_objects
|
||||||
|
self._name = name
|
||||||
|
self._import_structure = import_structure
|
||||||
|
|
||||||
# Needed for autocompletion in an IDE
|
# Needed for autocompletion in an IDE
|
||||||
def __dir__(self):
|
def __dir__(self):
|
||||||
return super().__dir__() + self.__all__
|
return super().__dir__() + self.__all__
|
||||||
|
|
||||||
def __getattr__(self, name: str) -> Any:
|
def __getattr__(self, name: str) -> Any:
|
||||||
|
if name in self._objects:
|
||||||
|
return self._objects[name]
|
||||||
if name in self._modules:
|
if name in self._modules:
|
||||||
value = self._get_module(name)
|
value = self._get_module(name)
|
||||||
elif name in self._class_to_module.keys():
|
elif name in self._class_to_module.keys():
|
||||||
@@ -1898,8 +1905,11 @@ class _BaseLazyModule(ModuleType):
|
|||||||
setattr(self, name, value)
|
setattr(self, name, value)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def _get_module(self, module_name: str) -> ModuleType:
|
def _get_module(self, module_name: str):
|
||||||
raise NotImplementedError
|
return importlib.import_module("." + module_name, self.__name__)
|
||||||
|
|
||||||
|
def __reduce__(self):
|
||||||
|
return (self.__class__, (self._name, self._import_structure))
|
||||||
|
|
||||||
|
|
||||||
def copy_func(f):
|
def copy_func(f):
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -104,19 +104,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_flax_available, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -200,19 +200,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,13 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -90,19 +84,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_sentencepiece_available, is_tokenizers_available
|
from ...file_utils import _LazyModule, is_sentencepiece_available, is_tokenizers_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {}
|
_import_structure = {}
|
||||||
@@ -39,19 +39,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_barthez_fast import BarthezTokenizerFast
|
from .tokenization_barthez_fast import BarthezTokenizerFast
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -137,19 +131,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_sentencepiece_available, is_torch_available
|
from ...file_utils import _LazyModule, is_sentencepiece_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -52,19 +52,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule
|
from ...file_utils import _LazyModule
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -30,19 +30,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_bert_japanese import BertJapaneseTokenizer, CharacterTokenizer, MecabTokenizer
|
from .tokenization_bert_japanese import BertJapaneseTokenizer, CharacterTokenizer, MecabTokenizer
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule
|
from ...file_utils import _LazyModule
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -30,19 +30,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_bertweet import BertweetTokenizer
|
from .tokenization_bertweet import BertweetTokenizer
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_flax_available,
|
is_flax_available,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
@@ -103,19 +103,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -52,19 +52,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -65,19 +65,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -62,19 +62,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule
|
from ...file_utils import _LazyModule
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -29,19 +29,6 @@ _import_structure = {
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .tokenization_byt5 import ByT5Tokenizer
|
from .tokenization_byt5 import ByT5Tokenizer
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -94,19 +94,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -58,19 +58,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_flax_available,
|
is_flax_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
is_torch_available,
|
is_torch_available,
|
||||||
@@ -90,19 +90,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -93,19 +93,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule
|
from ...file_utils import _LazyModule
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -30,19 +30,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_cpm import CpmTokenizer
|
from .tokenization_cpm import CpmTokenizer
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -68,19 +68,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -60,19 +60,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -54,19 +54,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available, is_vision_available
|
from ...file_utils import _LazyModule, is_torch_available, is_vision_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -54,19 +54,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_timm_available, is_vision_available
|
from ...file_utils import _LazyModule, is_timm_available, is_vision_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -54,19 +54,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -88,19 +88,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -109,19 +109,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -122,19 +116,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -36,19 +36,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_encoder_decoder import EncoderDecoderModel
|
from .modeling_encoder_decoder import EncoderDecoderModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -80,19 +80,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -38,19 +38,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_fsmt import FSMTForConditionalGeneration, FSMTModel, PretrainedFSMTModel
|
from .modeling_fsmt import FSMTForConditionalGeneration, FSMTModel, PretrainedFSMTModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -97,19 +97,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -93,19 +87,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_flax_gpt2 import FlaxGPT2LMHeadModel, FlaxGPT2Model, FlaxGPT2PreTrainedModel
|
from .modeling_flax_gpt2 import FlaxGPT2LMHeadModel, FlaxGPT2Model, FlaxGPT2PreTrainedModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_flax_available, is_torch_available
|
from ...file_utils import _LazyModule, is_flax_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -60,19 +60,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available
|
from ...file_utils import _LazyModule, is_tokenizers_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -36,19 +36,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_herbert_fast import HerbertTokenizerFast
|
from .tokenization_herbert_fast import HerbertTokenizerFast
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -46,19 +46,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -53,19 +53,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig
|
from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig
|
||||||
from .tokenization_layoutlm import LayoutLMTokenizer
|
from .tokenization_layoutlm import LayoutLMTokenizer
|
||||||
|
|
||||||
@@ -81,19 +81,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -64,19 +64,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_tf_led import TFLEDForConditionalGeneration, TFLEDModel, TFLEDPreTrainedModel
|
from .modeling_tf_led import TFLEDForConditionalGeneration, TFLEDModel, TFLEDPreTrainedModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -90,19 +90,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -52,19 +52,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -80,19 +80,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -49,19 +49,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -65,19 +65,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_tf_marian import TFMarianModel, TFMarianMTModel, TFMarianPreTrainedModel
|
from .modeling_tf_marian import TFMarianModel, TFMarianMTModel, TFMarianPreTrainedModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_flax_available,
|
is_flax_available,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
@@ -102,19 +102,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -58,19 +58,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -36,19 +36,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_mmbt import MMBTForClassification, MMBTModel, ModalEmbeddings
|
from .modeling_mmbt import MMBTForClassification, MMBTModel, ModalEmbeddings
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -100,19 +100,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -98,19 +92,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -74,21 +74,13 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_tf_mt5 import TFMT5EncoderModel, TFMT5ForConditionalGeneration, TFMT5Model
|
from .modeling_tf_mt5 import TFMT5EncoderModel, TFMT5ForConditionalGeneration, TFMT5Model
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
class _MT5LazyModule(_LazyModule):
|
||||||
"""
|
"""
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name == "MT5Tokenizer":
|
if name == "MT5Tokenizer":
|
||||||
return MT5Tokenizer
|
return MT5Tokenizer
|
||||||
@@ -97,4 +89,9 @@ else:
|
|||||||
else:
|
else:
|
||||||
return super().__getattr__(name)
|
return super().__getattr__(name)
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
sys.modules[__name__] = _MT5LazyModule(
|
||||||
|
__name__,
|
||||||
|
globals()["__file__"],
|
||||||
|
_import_structure,
|
||||||
|
extra_objects={"MT5Tokenizer": MT5Tokenizer, "MT5TokenizerFast": MT5TokenizerFast},
|
||||||
|
)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -82,19 +82,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -75,19 +75,6 @@ if TYPE_CHECKING:
|
|||||||
from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel
|
from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule
|
from ...file_utils import _LazyModule
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -30,19 +30,6 @@ if TYPE_CHECKING:
|
|||||||
from .tokenization_phobert import PhobertTokenizer
|
from .tokenization_phobert import PhobertTokenizer
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -54,19 +54,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -61,19 +61,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_sentencepiece_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_sentencepiece_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -68,19 +68,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -52,19 +52,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
_BaseLazyModule,
|
|
||||||
is_flax_available,
|
|
||||||
is_tf_available,
|
|
||||||
is_tokenizers_available,
|
|
||||||
is_torch_available,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -118,19 +112,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -97,19 +97,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_sentencepiece_available, is_speech_available, is_torch_available
|
from ...file_utils import _LazyModule, is_sentencepiece_available, is_speech_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -66,19 +66,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -64,19 +64,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_flax_available,
|
is_flax_available,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
@@ -98,19 +98,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -52,19 +52,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -76,19 +76,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available
|
from ...file_utils import _LazyModule, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -56,19 +56,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_flax_available, is_torch_available, is_vision_available
|
from ...file_utils import _LazyModule, is_flax_available, is_torch_available, is_vision_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -62,19 +62,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_flax_available, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_flax_available, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -88,19 +88,6 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available
|
||||||
|
|
||||||
|
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
@@ -84,19 +84,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -94,19 +94,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...file_utils import (
|
from ...file_utils import (
|
||||||
_BaseLazyModule,
|
_LazyModule,
|
||||||
is_sentencepiece_available,
|
is_sentencepiece_available,
|
||||||
is_tf_available,
|
is_tf_available,
|
||||||
is_tokenizers_available,
|
is_tokenizers_available,
|
||||||
@@ -102,19 +102,6 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
{%- if cookiecutter.generate_tensorflow_and_pytorch == "PyTorch & TensorFlow" %}
|
{%- if cookiecutter.generate_tensorflow_and_pytorch == "PyTorch & TensorFlow" %}
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_torch_available, is_tokenizers_available
|
from ...file_utils import _LazyModule, is_tf_available, is_torch_available, is_tokenizers_available
|
||||||
{%- elif cookiecutter.generate_tensorflow_and_pytorch == "PyTorch" %}
|
{%- elif cookiecutter.generate_tensorflow_and_pytorch == "PyTorch" %}
|
||||||
from ...file_utils import _BaseLazyModule, is_torch_available, is_tokenizers_available
|
from ...file_utils import _LazyModule, is_torch_available, is_tokenizers_available
|
||||||
{%- elif cookiecutter.generate_tensorflow_and_pytorch == "TensorFlow" %}
|
{%- elif cookiecutter.generate_tensorflow_and_pytorch == "TensorFlow" %}
|
||||||
from ...file_utils import _BaseLazyModule, is_tf_available, is_tokenizers_available
|
from ...file_utils import _LazyModule, is_tf_available, is_tokenizers_available
|
||||||
{% endif %}
|
{% endif %}
|
||||||
_import_structure = {
|
_import_structure = {
|
||||||
"configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP", "{{cookiecutter.camelcase_modelname}}Config"],
|
"configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP", "{{cookiecutter.camelcase_modelname}}Config"],
|
||||||
@@ -148,19 +148,6 @@ if TYPE_CHECKING:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
else:
|
else:
|
||||||
import importlib
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class _LazyModule(_BaseLazyModule):
|
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
|
||||||
"""
|
|
||||||
Module class that surfaces all objects but only performs associated imports when the objects are requested.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__file__ = globals()["__file__"]
|
|
||||||
__path__ = [os.path.dirname(__file__)]
|
|
||||||
|
|
||||||
def _get_module(self, module_name: str):
|
|
||||||
return importlib.import_module("." + module_name, self.__name__)
|
|
||||||
|
|
||||||
sys.modules[__name__] = _LazyModule(__name__, _import_structure)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user