





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_UpperCAmelCase       : str			     =       {
    """configuration_transfo_xl""": ["""TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP""", """TransfoXLConfig"""],
    """tokenization_transfo_xl""": ["""TransfoXLCorpus""", """TransfoXLTokenizer"""],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCAmelCase       : Optional[int]			     =       [
        """TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """AdaptiveEmbedding""",
        """TransfoXLForSequenceClassification""",
        """TransfoXLLMHeadModel""",
        """TransfoXLModel""",
        """TransfoXLPreTrainedModel""",
        """load_tf_weights_in_transfo_xl""",
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCAmelCase       : Optional[int]			     =       [
        """TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """TFAdaptiveEmbedding""",
        """TFTransfoXLForSequenceClassification""",
        """TFTransfoXLLMHeadModel""",
        """TFTransfoXLMainLayer""",
        """TFTransfoXLModel""",
        """TFTransfoXLPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig
    from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_transfo_xl import (
            TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
            AdaptiveEmbedding,
            TransfoXLForSequenceClassification,
            TransfoXLLMHeadModel,
            TransfoXLModel,
            TransfoXLPreTrainedModel,
            load_tf_weights_in_transfo_xl,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_transfo_xl import (
            TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFAdaptiveEmbedding,
            TFTransfoXLForSequenceClassification,
            TFTransfoXLLMHeadModel,
            TFTransfoXLMainLayer,
            TFTransfoXLModel,
            TFTransfoXLPreTrainedModel,
        )

else:
    import sys

    _UpperCAmelCase       : List[Any]			     =       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)












from ..utils import DummyObject, requires_backends

class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   Tuple    ,  *UpperCAmelCase						:   str    ,  **UpperCAmelCase						:   Optional[int]			)    ->			List[str]:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   Union[str, Any]    ,  *UpperCAmelCase						:   Dict    ,  **UpperCAmelCase						:   List[str]			)    ->			int:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   Any    ,  *UpperCAmelCase						:   List[Any]    ,  **UpperCAmelCase						:   Tuple			)    ->			Union[str, Any]:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)


class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   List[Any]    ,  *UpperCAmelCase						:   Union[str, Any]    ,  **UpperCAmelCase						:   Dict			)    ->			Any:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   str    ,  *UpperCAmelCase						:   Union[str, Any]    ,  **UpperCAmelCase						:   Union[str, Any]			)    ->			Tuple:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   List[Any]    ,  *UpperCAmelCase						:   str    ,  **UpperCAmelCase						:   Dict			)    ->			str:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)


class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   Dict    ,  *UpperCAmelCase						:   Dict    ,  **UpperCAmelCase						:   Dict			)    ->			Optional[int]:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   Optional[Any]    ,  *UpperCAmelCase						:   Union[str, Any]    ,  **UpperCAmelCase						:   Any			)    ->			Any:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   List[str]    ,  *UpperCAmelCase						:   Any    ,  **UpperCAmelCase						:   Dict			)    ->			Tuple:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)


class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   Union[str, Any]    ,  *UpperCAmelCase						:   Optional[int]    ,  **UpperCAmelCase						:   Optional[int]			)    ->			Any:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   List[Any]    ,  *UpperCAmelCase						:   Dict    ,  **UpperCAmelCase						:   int			)    ->			Dict:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   Dict    ,  *UpperCAmelCase						:   Dict    ,  **UpperCAmelCase						:   Optional[int]			)    ->			Optional[int]:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)


class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   List[str]    ,  *UpperCAmelCase						:   List[Any]    ,  **UpperCAmelCase						:   List[str]			)    ->			Optional[int]:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   List[Any]    ,  *UpperCAmelCase						:   Optional[Any]    ,  **UpperCAmelCase						:   Optional[Any]			)    ->			str:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   List[Any]    ,  *UpperCAmelCase						:   Optional[int]    ,  **UpperCAmelCase						:   Any			)    ->			Any:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)


class      lowerCAmelCase							(      metaclass=__UpperCamelCase    ):
 UpperCAmelCase__									=	["""torch""", """transformers""", """onnx"""]
 def __init__(   self						:   List[str]    ,  *UpperCAmelCase						:   Tuple    ,  **UpperCAmelCase						:   Optional[int]			)    ->			Optional[Any]:
     requires_backends(self    ,  ['torch', 'transformers', 'onnx']			)
 @classmethod
 def   A_			(   cls						:   Union[str, Any]    ,  *UpperCAmelCase						:   List[Any]    ,  **UpperCAmelCase						:   Optional[Any]			)    ->			Tuple:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)







 @classmethod
 def   A_			(   cls						:   Tuple    ,  *UpperCAmelCase						:   List[str]    ,  **UpperCAmelCase						:   List[str]			)    ->			Tuple:
     requires_backends(cls    ,  ['torch', 'transformers', 'onnx']			)





