




from typing import TYPE_CHECKING

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


_snake_case										=       {
    "configuration_rag": ["RagConfig"],
    "retrieval_rag": ["RagRetriever"],
    "tokenization_rag": ["RagTokenizer"],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case										=       [
      "RagModel",
      "RagPreTrainedModel",
      "RagSequenceForGeneration",
      "RagTokenForGeneration",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case										=       [
      "TFRagModel",
      "TFRagPreTrainedModel",
      "TFRagSequenceForGeneration",
      "TFRagTokenForGeneration",
  ]


if TYPE_CHECKING:
  from .configuration_rag import RagConfig
  from .retrieval_rag import RagRetriever
  from .tokenization_rag import RagTokenizer

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_rag import RagModel, RagPreTrainedModel, RagSequenceForGeneration, RagTokenForGeneration

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_rag import (
        TFRagModel,
        TFRagPreTrainedModel,
        TFRagSequenceForGeneration,
        TFRagTokenForGeneration,
    )

else:
  import sys

  _snake_case										=       _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_       : int         =			logging.get_logger(__name__)

A_       : Optional[Any]         =			{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}



class     _a						(__magic_name__				):


					'''simple docstring'''






					UpperCAmelCase__:   List[Any]  							=       '''mgp-str'''






					def __init__( self    ,       A__=[32, 128]    ,       A__=4    ,       A__=3    ,       A__=27    ,       A__=38    ,       A__=5_0257    ,       A__=3_0522    ,       A__=768    ,       A__=12    ,       A__=12    ,       A__=4.0    ,       A__=True    ,       A__=False    ,       A__=1e-5    ,       A__=0.0    ,       A__=0.0    ,       A__=0.0    ,       A__=False    ,       A__=0.0_2    ,       **A__    ,       ):
						super().__init__(**A__			)

						A__							:    Dict        =		image_size
						A__							:    int        =		patch_size
						A__							:    Dict        =		num_channels
						A__							:    List[Any]        =		max_token_length
						A__							:    str        =		num_character_labels
						A__							:    Tuple        =		num_bpe_labels
						A__							:    Optional[Any]        =		num_wordpiece_labels
						A__							:    Optional[int]        =		hidden_size
						A__							:    Tuple        =		num_hidden_layers
						A__							:    Any        =		num_attention_heads
						A__							:    List[Any]        =		mlp_ratio
						A__							:    Tuple        =		distilled
						A__							:    Union[str, Any]        =		layer_norm_eps
						A__							:    Tuple        =		drop_rate
						A__							:    List[str]        =		qkv_bias
						A__							:    Optional[Any]        =		attn_drop_rate
						A__							:    Union[str, Any]        =		drop_path_rate
						A__							:    Optional[Any]        =		output_aa_attentions
						A__							:    Optional[int]        =		initializer_range



