

"""simple docstring"""
import json
import os
from typing import TYPE_CHECKING, List, Optional, Tuple

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


if TYPE_CHECKING:
 from transformers.pipelines.conversational import Conversation

A									=						logging.get_logger(__name__)

A									=						{"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt"""}

A									=						{
    """vocab_file""": {
        """microsoft/deberta-base""": """https://huggingface.co/microsoft/deberta-base/resolve/main/vocab.json""",
        """microsoft/deberta-large""": """https://huggingface.co/microsoft/deberta-large/resolve/main/vocab.json""",
        """microsoft/deberta-xlarge""": """https://huggingface.co/microsoft/deberta-xlarge/resolve/main/vocab.json""",
        """microsoft/deberta-base-mnli""": """https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/vocab.json""",
        """microsoft/deberta-large-mnli""": """https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/vocab.json""",
        """microsoft/deberta-xlarge-mnli""": (
            """https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/vocab.json"""
        ),
    },
    """merges_file""": {
        """microsoft/deberta-base""": """https://huggingface.co/microsoft/deberta-base/resolve/main/merges.txt""",
        """microsoft/deberta-large""": """https://huggingface.co/microsoft/deberta-large/resolve/main/merges.txt""",
        """microsoft/deberta-xlarge""": """https://huggingface.co/microsoft/deberta-xlarge/resolve/main/merges.txt""",
        """microsoft/deberta-base-mnli""": """https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/merges.txt""",
        """microsoft/deberta-large-mnli""": """https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/merges.txt""",
        """microsoft/deberta-xlarge-mnli""": (
            """https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/merges.txt"""
        ),
    },
}

A									=						{
    """microsoft/deberta-base""": 512,
    """microsoft/deberta-large""": 512,
    """microsoft/deberta-xlarge""": 512,
    """microsoft/deberta-base-mnli""": 512,
    """microsoft/deberta-large-mnli""": 512,
    """microsoft/deberta-xlarge-mnli""": 512,
}

A									=						{
    """microsoft/deberta-base""": {"""do_lower_case""": False},
    """microsoft/deberta-large""": {"""do_lower_case""": False},
}







def       UpperCamelCase_					(     )						->     Any:



       """simple docstring"""







       __magic_name__			:		str        =     (
           list(range(ord('''!'''   )     , ord('''~'''   ) + 1   )   ) + list(range(ord('''¡'''   )     , ord('''¬'''   ) + 1   )   ) + list(range(ord('''®'''   )     , ord('''ÿ'''   ) + 1   )   )
       )
       __magic_name__			:		List[Any]        =     bs[:]
       __magic_name__			:		Dict        =     0
       for b in range(2**8   ):
              if b not in bs:
                     bs.append(lowercase__   )
                     cs.append(2**8 + n   )
                     n += 1
       __magic_name__			:		Optional[Any]        =     [chr(lowercase__   ) for n in cs]
       return dict(zip(lowercase__     , lowercase__   )   )







def       UpperCamelCase_					(     lowerCamelCase							:					List[str]   )						->     Any:



       """simple docstring"""







       __magic_name__			:		Tuple        =     set()
       __magic_name__			:		Tuple        =     word[0]
       for char in word[1:]:
              pairs.add((prev_char, char)   )
              __magic_name__			:		Tuple        =     char
       return pairs



class        _UpperCamelCase	(						_UpperCAmelCase	):


  """simple docstring"""





  snake_case_        =    VOCAB_FILES_NAMES
  snake_case_        =    PRETRAINED_VOCAB_FILES_MAP
  snake_case_        =    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  snake_case_        =    ["""input_ids""", """attention_mask""", """token_type_ids"""]



  def __init__( self					: str       ,       snake_case					: Union[str, Any]       ,       snake_case					: Any       ,       snake_case					: Optional[int]="replace"       ,       snake_case					: Dict="[CLS]"       ,       snake_case					: Optional[int]="[SEP]"       ,       snake_case					: List[str]="[SEP]"       ,       snake_case					: List[Any]="[CLS]"       ,       snake_case					: Tuple="[UNK]"       ,       snake_case					: Any="[PAD]"       ,       snake_case					: Optional[Any]="[MASK]"       ,       snake_case					: Any=False       ,       snake_case					: Tuple=False       ,       **snake_case					: Optional[int]       ,       )	->			Optional[int]:


         '''simple docstring'''





         __magic_name__			:		Union[str, Any]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else bos_token
         __magic_name__			:		Optional[int]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else eos_token
         __magic_name__			:		Optional[Any]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else sep_token
         __magic_name__			:		List[str]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else cls_token
         __magic_name__			:		Optional[Any]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else unk_token
         __magic_name__			:		Union[str, Any]        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else pad_token

         # Mask token behave like a normal word, i.e. include the space before it
         __magic_name__			:		Dict        =     AddedToken(snake_case       ,       lstrip=snake_case       ,       rstrip=snake_case      ) if isinstance(snake_case       ,       snake_case      ) else mask_token

         super().__init__(
             errors=snake_case       ,       bos_token=snake_case       ,       eos_token=snake_case       ,       unk_token=snake_case       ,       sep_token=snake_case       ,       cls_token=snake_case       ,       pad_token=snake_case       ,       mask_token=snake_case       ,       add_prefix_space=snake_case       ,       add_bos_token=snake_case       ,       **snake_case       ,       )
         __magic_name__			:		Tuple        =     add_bos_token

         with open(snake_case       ,       encoding='''utf-8'''      ) as vocab_handle:
                __magic_name__			:		List[Any]        =     json.load(snake_case      )
         __magic_name__			:		Tuple        =     {v: k for k, v in self.encoder.items()}
         __magic_name__			:		str        =     errors  # how to handle errors in decoding
         __magic_name__			:		Union[str, Any]        =     bytes_to_unicode()
         __magic_name__			:		str        =     {v: k for k, v in self.byte_encoder.items()}
         with open(snake_case       ,       encoding='''utf-8'''      ) as merges_handle:
                __magic_name__			:		Optional[Any]        =     merges_handle.read().split('''\n'''      )[1:-1]
         __magic_name__			:		Tuple        =     [tuple(merge.split()      ) for merge in bpe_merges]
         __magic_name__			:		Any        =     dict(zip(snake_case       ,       range(len(snake_case      )      )      )      )
         __magic_name__			:		Any        =     {}
         __magic_name__			:		Union[str, Any]        =     add_prefix_space

         # Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
         __magic_name__			:		str        =     re.compile(R'''\'s|\'t|\'re|\'ve|\'m|\'ll|\'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+'''      )



  @property
  # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer.vocab_size
  def 							_UpperCAmelCase      ( self					: Union[str, Any]      )	->			Optional[int]:


         '''simple docstring'''





         return len(self.encoder      )



  def 							_UpperCAmelCase      ( self					: Optional[Any]      )	->			List[Any]:


         '''simple docstring'''





         return dict(self.encoder       ,       **self.added_tokens_encoder      )



  def 							_UpperCAmelCase      ( self					: Any       ,       snake_case					: Optional[Any]      )	->			str:


         '''simple docstring'''





         if token in self.cache:
                return self.cache[token]
         __magic_name__			:		int        =     tuple(snake_case      )
         __magic_name__			:		List[Any]        =     get_pairs(snake_case      )

         if not pairs:
                return token

         while True:
                __magic_name__			:		Tuple        =     min(snake_case       ,       key=lambda snake_case      : self.bpe_ranks.get(snake_case       ,       float('''inf'''      )      )      )
                if bigram not in self.bpe_ranks:
                       break
                __magic_name__       ,							__magic_name__			:		Dict        =     bigram
                __magic_name__			:		int        =     []
                __magic_name__			:		Any        =     0
                while i < len(snake_case      ):
                       try:
                              __magic_name__			:		Optional[int]        =     word.index(snake_case       ,       snake_case      )
                       except ValueError:
                              new_word.extend(word[i:]      )
                              break
                       else:
                              new_word.extend(word[i:j]      )
                              __magic_name__			:		List[str]        =     j

                       if word[i] == first and i < len(snake_case      ) - 1 and word[i + 1] == second:
                              new_word.append(first + second      )
                              i += 2
                       else:
                              new_word.append(word[i]      )
                              i += 1
                __magic_name__			:		Optional[Any]        =     tuple(snake_case      )
                __magic_name__			:		List[Any]        =     new_word
                if len(snake_case      ) == 1:
                       break
                else:
                       __magic_name__			:		List[Any]        =     get_pairs(snake_case      )
         __magic_name__			:		Optional[Any]        =     ''' '''.join(snake_case      )
         __magic_name__			:		Any        =     word
         return word



  def 							_UpperCAmelCase      ( self					: Any       ,       snake_case					: List[int]       ,       snake_case					: Optional[List[int]] = None      )	->			List[int]:


         '''simple docstring'''





         if token_ids_a is None:
                return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
         __magic_name__			:		Optional[int]        =     [self.cls_token_id]
         __magic_name__			:		str        =     [self.sep_token_id]
         return cls + token_ids_a + sep + token_ids_a + sep



  def 							_UpperCAmelCase      ( self					: Optional[Any]       ,       snake_case					: List[int]       ,       snake_case					: Optional[List[int]] = None       ,       snake_case					: bool = False      )	->			List[int]:


         '''simple docstring'''





         if already_has_special_tokens:
                return super().get_special_tokens_mask(
                    token_ids_a=snake_case       ,       token_ids_a=snake_case       ,       already_has_special_tokens=snake_case      )

         if token_ids_a is None:
                return [1] + ([0] * len(snake_case      )) + [1]
         return [1] + ([0] * len(snake_case      )) + [1] + ([0] * len(snake_case      )) + [1]



  def 							_UpperCAmelCase      ( self					: Optional[int]       ,       snake_case					: List[int]       ,       snake_case					: Optional[List[int]] = None      )	->			List[int]:


         '''simple docstring'''





         __magic_name__			:		str        =     [self.sep_token_id]
         __magic_name__			:		Tuple        =     [self.cls_token_id]

         if token_ids_a is None:
                return len(cls + token_ids_a + sep      ) * [0]
         return len(cls + token_ids_a + sep      ) * [0] + len(token_ids_a + sep      ) * [1]



  def 							_UpperCAmelCase      ( self					: str       ,       snake_case					: Any      )	->			Dict:


         '''simple docstring'''





         __magic_name__			:		int        =     []
         for token in re.findall(self.pat       ,       snake_case      ):
                __magic_name__			:		Any        =     ''''''.join(
                    self.byte_encoder[b] for b in token.encode('''utf-8'''      )      )  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
                bpe_tokens.extend(bpe_token for bpe_token in self.bpe(snake_case      ).split(''' '''      )      )
         return bpe_tokens



  def 							_UpperCAmelCase      ( self					: Any       ,       snake_case					: Optional[Any]      )	->			List[str]:


         '''simple docstring'''





         return self.encoder.get(snake_case       ,       self.encoder.get(self.unk_token      )      )



  def 							_UpperCAmelCase      ( self					: Tuple       ,       snake_case					: Any      )	->			List[Any]:


         '''simple docstring'''





         return self.decoder.get(snake_case      )



  def 							_UpperCAmelCase      ( self					: Dict       ,       snake_case					: Tuple      )	->			List[str]:


         '''simple docstring'''





         __magic_name__			:		Any        =     ''''''.join(snake_case      )
         __magic_name__			:		Tuple        =     bytearray([self.byte_decoder[c] for c in text]      ).decode('''utf-8'''       ,       errors=self.errors      )
         return text



  def 							_UpperCAmelCase      ( self					: Optional[int]       ,       snake_case					: str       ,       snake_case					: Optional[str] = None      )	->			Tuple[str]:


         '''simple docstring'''





         if not os.path.isdir(snake_case      ):
                logger.error(f"""Vocabulary path ({save_directory}) should be a directory"""      )
                return
         __magic_name__			:		int        =     os.path.join(
             snake_case       ,       (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']      )
         __magic_name__			:		Optional[Any]        =     os.path.join(
             snake_case       ,       (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''merges_file''']      )

         with open(snake_case       ,       '''w'''       ,       encoding='''utf-8'''      ) as f:
                f.write(json.dumps(self.encoder       ,       indent=2       ,       sort_keys=snake_case       ,       ensure_ascii=snake_case      ) + '''\n'''      )

         __magic_name__			:		str        =     0
         with open(snake_case       ,       '''w'''       ,       encoding='''utf-8'''      ) as writer:
                writer.write('''#version: 0.2\n'''      )
                for bpe_tokens, token_index in sorted(self.bpe_ranks.items()       ,       key=lambda snake_case      : kv[1]      ):
                       if index != token_index:
                              logger.warning(
                                  f"""Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."""
                                  ''' Please check that the tokenizer is not corrupted!'''      )
                              __magic_name__			:		Dict        =     token_index
                       writer.write(''' '''.join(snake_case      ) + '''\n'''      )
                       index += 1

         return vocab_file, merge_file



  def 							_UpperCAmelCase      ( self					: Optional[int]       ,       snake_case					: str       ,       snake_case					: Any=False       ,       **snake_case					: List[Any]      )	->			Dict:


         '''simple docstring'''





         __magic_name__			:		Tuple        =     kwargs.pop('''add_prefix_space'''       ,       self.add_prefix_space      )
         if (is_split_into_words or add_prefix_space) and (len(snake_case      ) > 0 and not text[0].isspace()):
                __magic_name__			:		Union[str, Any]        =     ''' ''' + text
         return (text, kwargs)




  def 							_UpperCAmelCase      ( self					: List[Any]       ,       snake_case					: "Conversation"      )	->			List[int]:


         '''simple docstring'''





         __magic_name__			:		List[str]        =     []
         for is_user, text in conversation.iter_texts():
                input_ids.extend(self.encode(snake_case       ,       add_special_tokens=snake_case      ) + [self.eos_token_id]      )
         if len(snake_case      ) > self.model_max_length:
                __magic_name__			:		int        =     input_ids[-self.model_max_length :]
         return input_ids





# 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 json
import os
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union

import yaml

from ...utils import ComputeEnvironment, DistributedType, SageMakerDistributedType
from ...utils.constants import SAGEMAKER_PYTHON_VERSION, SAGEMAKER_PYTORCH_VERSION, SAGEMAKER_TRANSFORMERS_VERSION


UpperCamelCase__			=    os.path.expanduser(
    os.getenv("HF_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "huggingface"))
)
UpperCamelCase__			=    os.path.join(hf_cache_home, "accelerate")
UpperCamelCase__			=    os.path.join(cache_dir, "default_config.yaml")
UpperCamelCase__			=    os.path.join(cache_dir, "default_config.yaml")

# For backward compatibility: the default config is the json one if it's the only existing file.
if os.path.isfile(default_yaml_config_file) or not os.path.isfile(default_json_config_file):
			UpperCamelCase__			=    default_yaml_config_file
else:
			UpperCamelCase__			=    default_json_config_file






def 			UpperCAmelCase__     (     lowercase__ )			->   int:
						if config_file is not None:
												if not os.path.isfile(lowercase__ ):
																		raise FileNotFoundError(
																		    F"The passed configuration file `{config_file}` does not exist. "
																		    """Please pass an existing file to `accelerate launch`, or use the the default one """
																		    """created through `accelerate config` and run `accelerate launch` """
																		    """without the `--config_file` argument.""" )
						else:
												__lowercase											=					default_config_file
						with open(lowercase__    ,							"""r"""    ,							encoding="""utf-8""" ) as f:
												if config_file.endswith(""".json""" ):
																		if (
																		    json.load(lowercase__ ).get("""compute_environment"""    ,							ComputeEnvironment.LOCAL_MACHINE )
																		    == ComputeEnvironment.LOCAL_MACHINE
																		):
																								__lowercase											=					ClusterConfig
																		else:
																								__lowercase											=					SageMakerConfig
																		return config_class.from_json_file(json_file=lowercase__ )
												else:
																		if (
																		    yaml.safe_load(lowercase__ ).get("""compute_environment"""    ,							ComputeEnvironment.LOCAL_MACHINE )
																		    == ComputeEnvironment.LOCAL_MACHINE
																		):
																								__lowercase											=					ClusterConfig
																		else:
																								__lowercase											=					SageMakerConfig
																		return config_class.from_yaml_file(yaml_file=lowercase__ )
@dataclass
class       _lowerCAmelCase :






			"""simple docstring"""





			lowercase__   :	ComputeEnvironment
			lowercase__   :	Union[DistributedType, SageMakerDistributedType]
			lowercase__   :	str
			lowercase__   :	bool





			def 		snake_case__      (					self						:							Union[str, Any] )    ->       List[Any]:
									"""simple docstring"""







									__lowercase											=					self.__dict__
									# For serialization, it's best to convert Enums to strings (or their underlying value type).
									for key, value in result.items():
															if isinstance(lowercase      ,  lowercase ):
																					__lowercase											=					value.value
															if isinstance(lowercase      ,  lowercase ) and not bool(lowercase ):
																					__lowercase											=					None
									__lowercase											=					{k: v for k, v in result.items() if v is not None}
									return result





			@classmethod
			def 		snake_case__      (					cls						:							List[str]      ,  lowercase						:							List[str]=None )    ->       Union[str, Any]:
									"""simple docstring"""







									__lowercase											=					default_json_config_file if json_file is None else json_file
									with open(lowercase      ,  """r"""      ,  encoding="""utf-8""" ) as f:
															__lowercase											=					json.load(lowercase )
									if "compute_environment" not in config_dict:
															__lowercase											=					ComputeEnvironment.LOCAL_MACHINE
									if "mixed_precision" not in config_dict:
															__lowercase											=					"""fp16""" if ("""fp16""" in config_dict and config_dict["""fp16"""]) else None
									if "fp16" in config_dict:  # Convert the config to the new format.
															del config_dict["fp16"]
									if "dynamo_backend" in config_dict:  # Convert the config to the new format.
															__lowercase											=					config_dict.pop("""dynamo_backend""" )
															__lowercase											=					{} if dynamo_backend == """NO""" else {"""dynamo_backend""": dynamo_backend}
									if "use_cpu" not in config_dict:
															__lowercase											=					False
									return cls(**lowercase )





			def 		snake_case__      (					self						:							Tuple      ,  lowercase						:							str )    ->       Any:
									"""simple docstring"""







									with open(lowercase      ,  """w"""      ,  encoding="""utf-8""" ) as f:
															__lowercase											=					json.dumps(self.to_dict()      ,  indent=2      ,  sort_keys=lowercase ) + """\n"""
															f.write(lowercase )





			@classmethod
			def 		snake_case__      (					cls						:							List[str]      ,  lowercase						:							Optional[Any]=None )    ->       Union[str, Any]:
									"""simple docstring"""







									__lowercase											=					default_yaml_config_file if yaml_file is None else yaml_file
									with open(lowercase      ,  """r"""      ,  encoding="""utf-8""" ) as f:
															__lowercase											=					yaml.safe_load(lowercase )
									if "compute_environment" not in config_dict:
															__lowercase											=					ComputeEnvironment.LOCAL_MACHINE

									if "mixed_precision" not in config_dict:
															__lowercase											=					"""fp16""" if ("""fp16""" in config_dict and config_dict["""fp16"""]) else None
									if isinstance(config_dict["""mixed_precision"""]      ,  lowercase ) and not config_dict["mixed_precision"]:
															__lowercase											=					"""no"""
									if "fp16" in config_dict:  # Convert the config to the new format.
															del config_dict["fp16"]
									if "dynamo_backend" in config_dict:  # Convert the config to the new format.
															__lowercase											=					config_dict.pop("""dynamo_backend""" )
															__lowercase											=					{} if dynamo_backend == """NO""" else {"""dynamo_backend""": dynamo_backend}
									if "use_cpu" not in config_dict:
															__lowercase											=					False
									return cls(**lowercase )





			def 		snake_case__      (					self						:							Union[str, Any]      ,  lowercase						:							Any )    ->       Tuple:
									"""simple docstring"""







									with open(lowercase      ,  """w"""      ,  encoding="""utf-8""" ) as f:
															yaml.safe_dump(self.to_dict()      ,  lowercase )







			def 		snake_case__      (					self						:							int )    ->       Optional[int]:
									"""simple docstring"""







									if isinstance(self.compute_environment      ,  lowercase ):
															__lowercase											=					ComputeEnvironment(self.compute_environment )
									if isinstance(self.distributed_type      ,  lowercase ):
															if self.compute_environment == ComputeEnvironment.AMAZON_SAGEMAKER:
																					__lowercase											=					SageMakerDistributedType(self.distributed_type )
															else:
																					__lowercase											=					DistributedType(self.distributed_type )
									if self.dynamo_config is None:
															__lowercase											=					{}





@dataclass
class       _lowerCAmelCase (			_UpperCAmelCase      ):






			"""simple docstring"""





			lowercase__   :	int
			lowercase__   :	int  			=      0
			lowercase__   :	int  			=      1
			lowercase__   :	Optional[str]  			=      None
			lowercase__   :	Optional[str]  			=      None
			lowercase__   :	Optional[int]  			=      None
			lowercase__   :	Optional[str]  			=      "static"
			lowercase__   :	Optional[bool]  			=      False
			lowercase__   :	str  			=      "main"

			# args for deepspeed_plugin
			lowercase__   :	dict  			=      None
			# args for fsdp
			lowercase__   :	dict  			=      None
			# args for megatron_lm
			lowercase__   :	dict  			=      None
			# args for ipex
			lowercase__   :	dict  			=      None
			# args for TPU
			lowercase__   :	bool  			=      False

			# args for TPU pods
			lowercase__   :	str  			=      None
			lowercase__   :	str  			=      None
			lowercase__   :	bool  			=      False
			lowercase__   :	bool  			=      False
			lowercase__   :	str  			=      None
			lowercase__   :	List[str]  			=      None
			lowercase__   :	List[str]  			=      None
			lowercase__   :	List[str]  			=      None

			# args for dynamo
			lowercase__   :	dict  			=      None





			def 		snake_case__      (					self						:							List[Any] )    ->       int:
									"""simple docstring"""







									if self.deepspeed_config is None:
															__lowercase											=					{}
									if self.fsdp_config is None:
															__lowercase											=					{}
									if self.megatron_lm_config is None:
															__lowercase											=					{}
									if self.ipex_config is None:
															__lowercase											=					{}
									return super().__post_init__()





@dataclass
class       _lowerCAmelCase (			_UpperCAmelCase      ):






			"""simple docstring"""





			lowercase__   :	str
			lowercase__   :	str
			lowercase__   :	Optional[str]  			=      None
			lowercase__   :	Optional[str]  			=      None
			lowercase__   :	str  			=      "us-east-1"
			lowercase__   :	int  			=      1
			lowercase__   :	str  			=      "all"
			lowercase__   :	str  			=      F'''accelerate-sagemaker-{num_machines}'''
			lowercase__   :	str  			=      SAGEMAKER_PYTORCH_VERSION
			lowercase__   :	str  			=      SAGEMAKER_TRANSFORMERS_VERSION
			lowercase__   :	str  			=      SAGEMAKER_PYTHON_VERSION
			lowercase__   :	str  			=      None
			lowercase__   :	str  			=      None
			lowercase__   :	dict  			=      None
			lowercase__   :	dict  			=      None





