






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCamelCase			=      logging.get_logger(__name__)

UpperCamelCase			=      {
    '''mnaylor/mega-base-wikitext''': '''https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json''',
}







class 		_a       (						A__   ):





   '''simple docstring'''






   UpperCamelCase__      					=    """mega"""





   def __init__(   self			,				UpperCAmelCase_=30_522			,				UpperCAmelCase_=128			,				UpperCAmelCase_=4			,				UpperCAmelCase_=256			,				UpperCAmelCase_=16			,				UpperCAmelCase_=True			,				UpperCAmelCase_=64			,				UpperCAmelCase_=False			,				UpperCAmelCase_=-1			,				UpperCAmelCase_=None			,				UpperCAmelCase_=True			,				UpperCAmelCase_="scalenorm"			,				UpperCAmelCase_=True			,				UpperCAmelCase_="silu"			,				UpperCAmelCase_="softmax"			,				UpperCAmelCase_=0.1			,				UpperCAmelCase_=0.1			,				UpperCAmelCase_=0.1			,				UpperCAmelCase_=False			,				UpperCAmelCase_=True			,				UpperCAmelCase_=256			,				UpperCAmelCase_=True			,				UpperCAmelCase_=0.1			,				UpperCAmelCase_=2_048			,				UpperCAmelCase_=False			,				UpperCAmelCase_=2			,				UpperCAmelCase_=0.02			,				UpperCAmelCase_=0.2			,				UpperCAmelCase_=0.02			,				UpperCAmelCase_=1.0			,				UpperCAmelCase_=1			,				UpperCAmelCase_=0			,				UpperCAmelCase_=2			,				UpperCAmelCase_="rotary"			,				UpperCAmelCase_=None			,				UpperCAmelCase_=True			,				UpperCAmelCase_=True			,				**UpperCAmelCase_			,				)	-> List[Any]:




          '''simple docstring'''




          super().__init__(pad_token_id=_A			,				bos_token_id=_A			,				eos_token_id=_A			,				**_A)

          lowercase__:    Optional[int]        =      vocab_size
          lowercase__:    Any        =      hidden_size
          lowercase__:    List[Any]        =      num_hidden_layers
          lowercase__:    int        =      activation
          lowercase__:    List[Any]        =      attention_activation
          lowercase__:    str        =      intermediate_size
          lowercase__:    Dict        =      ema_projection_size
          lowercase__:    Optional[Any]        =      bidirectional
          lowercase__:    Optional[Any]        =      shared_representation_size
          lowercase__:    str        =      use_chunking
          lowercase__:    Optional[int]        =      chunk_size
          lowercase__:    List[str]        =      truncation
          lowercase__:    List[str]        =      normalize_before_mega
          lowercase__:    int        =      normalization_type
          lowercase__:    Union[str, Any]        =      norm_affine
          lowercase__:    Dict        =      dropout_prob
          lowercase__:    Dict        =      hidden_dropout_prob
          lowercase__:    Optional[int]        =      attention_probs_dropout_prob
          lowercase__:    Dict        =      use_feature_dropout
          lowercase__:    List[Any]        =      use_normalized_ffn
          lowercase__:    List[str]        =      nffn_hidden_size
          lowercase__:    str        =      normalize_before_ffn
          lowercase__:    List[str]        =      nffn_activation_dropout_prob
          lowercase__:    Union[str, Any]        =      max_positions
          lowercase__:    List[str]        =      add_token_type_embeddings
          lowercase__:    Union[str, Any]        =      type_vocab_size
          lowercase__:    Tuple        =      initializer_range
          lowercase__:    str        =      ema_delta_alpha_range
          lowercase__:    List[Any]        =      ema_beta_range
          lowercase__:    int        =      ema_gamma_omega_range
          lowercase__:    Any        =      relative_positional_bias
          lowercase__:    List[str]        =      use_cache
          lowercase__:    List[str]        =      classifier_dropout
          lowercase__:    List[Any]        =      add_lm_hidden_dense_layer
          lowercase__:    int        =      1  # not used but required by Hugging Face







class 		_a       (						A__   ):





   '''simple docstring'''






   @property
   def __lowercase    (   self)	-> Tuple:




          '''simple docstring'''




          if self.task == "multiple-choice":
                 lowercase__:    Dict        =      {0: "batch", 1: "choice", 2: "sequence"}
          else:
                 lowercase__:    str        =      {0: "batch", 1: "sequence"}
          return OrderedDict(
              [
                  ("input_ids", dynamic_axis),
                  ("attention_mask", dynamic_axis),
              ])














"""simple docstring"""





# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ..utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCamelCase			=      {
    """agents""": ["""Agent""", """AzureOpenAiAgent""", """HfAgent""", """LocalAgent""", """OpenAiAgent"""],
    """base""": ["""PipelineTool""", """RemoteTool""", """Tool""", """launch_gradio_demo""", """load_tool"""],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase			=      ["""DocumentQuestionAnsweringTool"""]
  UpperCamelCase			=      ["""ImageCaptioningTool"""]
  UpperCamelCase			=      ["""ImageQuestionAnsweringTool"""]
  UpperCamelCase			=      ["""ImageSegmentationTool"""]
  UpperCamelCase			=      ["""SpeechToTextTool"""]
  UpperCamelCase			=      ["""TextClassificationTool"""]
  UpperCamelCase			=      ["""TextQuestionAnsweringTool"""]
  UpperCamelCase			=      ["""TextSummarizationTool"""]
  UpperCamelCase			=      ["""TextToSpeechTool"""]
  UpperCamelCase			=      ["""TranslationTool"""]

if TYPE_CHECKING:
  from .agents import Agent, AzureOpenAiAgent, HfAgent, LocalAgent, OpenAiAgent
  from .base import PipelineTool, RemoteTool, Tool, launch_gradio_demo, load_tool

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .document_question_answering import DocumentQuestionAnsweringTool
    from .image_captioning import ImageCaptioningTool
    from .image_question_answering import ImageQuestionAnsweringTool
    from .image_segmentation import ImageSegmentationTool
    from .speech_to_text import SpeechToTextTool
    from .text_classification import TextClassificationTool
    from .text_question_answering import TextQuestionAnsweringTool
    from .text_summarization import TextSummarizationTool
    from .text_to_speech import TextToSpeechTool
    from .translation import TranslationTool
else:
  import sys

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






