




# Copyright 2021 The HuggingFace 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.

import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


lowerCamelCase							:						List[Any]					       =  [
    "EAGER",
    "AOT_EAGER",
    "INDUCTOR",
    "NVFUSER",
    "AOT_NVFUSER",
    "AOT_CUDAGRAPHS",
    "OFI",
    "FX2TRT",
    "ONNXRT",
    "IPEX",
]

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Dict      ,				lowercase      :			Any=None      ,				lowercase      :			Optional[int]=None      ,				lowercase      :			Optional[int]=None	):


      '''simple docstring'''



      lowerCamelCase_							=       True
      while ask_again:
            lowerCamelCase_							=       input(lowercase	)
            try:
                  if default is not None and len(lowercase	) == 0:
                        return default
                  return convert_value(lowercase	) if convert_value is not None else result
            except Exception:
                  if error_message is not None:
                        print(lowercase	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Optional[int]      ,				lowercase      :			List[str]=[]      ,				lowercase      :			Dict=None      ,				lowercase      :			int=0	):


      '''simple docstring'''



      lowerCamelCase_							=       BulletMenu(lowercase      ,				lowercase	)
      lowerCamelCase_							=       menu.run(default_choice=lowercase	)
      return convert_value(lowercase	) if convert_value is not None else result

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Optional[Any]	):


      '''simple docstring'''



      lowerCamelCase_							=       int(lowercase	)
      return ComputeEnvironment(['LOCAL_MACHINE', 'AMAZON_SAGEMAKER'][value]	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Any	):


      '''simple docstring'''



      lowerCamelCase_							=       int(lowercase	)
      return DistributedType(['NO', 'MULTI_CPU', 'MULTI_XPU', 'MULTI_GPU', 'MULTI_NPU', 'TPU'][value]	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Dict	):


      '''simple docstring'''



      lowerCamelCase_							=       int(lowercase	)
      return DynamoBackend(DYNAMO_BACKENDS[value]	).value

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			List[Any]	):


      '''simple docstring'''



      lowerCamelCase_							=       int(lowercase	)
      return PrecisionType(['no', 'fp16', 'bf16', 'fp8'][value]	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			str	):


      '''simple docstring'''



      lowerCamelCase_							=       int(lowercase	)
      return SageMakerDistributedType(['NO', 'DATA_PARALLEL', 'MODEL_PARALLEL'][value]	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Optional[Any]	):


      '''simple docstring'''



      return {"yes": True, "no": False}[value.lower()]







class     A(		argparse.RawDescriptionHelpFormatter  ):



 '''simple docstring'''


 def 							a__					(							self   :    List[str]		,				A_   :    Tuple		,				A_   :    Optional[int]		,				A_   :    Union[str, Any]		,				A_   :    Any    )  ->      Dict:

       """simple docstring"""






       lowerCamelCase_							=       super()._format_usage(A_		,				A_		,				A_		,				A_    )
       lowerCamelCase_							=       usage.replace('<command> [<args>] '		,				''    )
       return usage








"""simple docstring"""







from typing import TYPE_CHECKING

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


a_							=    {
    """configuration_gpt_neox_japanese""": ["""GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoXJapaneseConfig"""],
    """tokenization_gpt_neox_japanese""": ["""GPTNeoXJapaneseTokenizer"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a_							=    [
	    """GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """GPTNeoXJapaneseForCausalLM""",
	    """GPTNeoXJapaneseLayer""",
	    """GPTNeoXJapaneseModel""",
	    """GPTNeoXJapanesePreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig
	from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_gpt_neox_japanese import (
		    GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
		    GPTNeoXJapaneseForCausalLM,
		    GPTNeoXJapaneseLayer,
		    GPTNeoXJapaneseModel,
		    GPTNeoXJapanesePreTrainedModel,
		)


else:
	import sys

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





