
"""simple docstring"""
import operator as op


lowercase_       :						Tuple     					=	'''scaler.pt'''
lowercase_       :						Any     					=	'''pytorch_model'''
lowercase_       :						str     					=	'''random_states'''
lowercase_       :						Optional[int]     					=	'''optimizer'''
lowercase_       :						str     					=	'''scheduler'''
lowercase_       :						Tuple     					=	'''pytorch_model.bin'''
lowercase_       :						Tuple     					=	'''pytorch_model.bin.index.json'''
lowercase_       :						Any     					=	'''model.safetensors'''
lowercase_       :						str     					=	'''model.safetensors.index.json'''
lowercase_       :						List[Any]     					=	'''1.10.2'''
lowercase_       :						Tuple     					=	'''py38'''
lowercase_       :						List[Any]     					=	'''4.17.0'''
lowercase_       :						Optional[int]     					=	['''ml.p3.16xlarge''', '''ml.p3dn.24xlarge''', '''ml.p4dn.24xlarge''']
lowercase_       :						Dict     					=	['''FULL_SHARD''', '''SHARD_GRAD_OP''', '''NO_SHARD''', '''HYBRID_SHARD''', '''HYBRID_SHARD_ZERO2''']
lowercase_       :						Optional[int]     					=	['''TRANSFORMER_BASED_WRAP''', '''SIZE_BASED_WRAP''', '''NO_WRAP''']
lowercase_       :						Optional[int]     					=	['''BACKWARD_PRE''', '''BACKWARD_POST''', '''NO_PREFETCH''']
lowercase_       :						List[str]     					=	['''FULL_STATE_DICT''', '''LOCAL_STATE_DICT''', '''SHARDED_STATE_DICT''']
lowercase_       :						List[Any]     					=	'''2.0.1'''
lowercase_       :						Any     					=	['''pdsh''', '''standard''', '''openmpi''', '''mvapich''']
lowercase_       :						List[str]     					=	['''default''', '''reduce-overhead''', '''max-autotune''']

lowercase_       :						Optional[int]     					=	{'''>''': op.gt, '''>=''': op.ge, '''==''': op.eq, '''!=''': op.ne, '''<=''': op.le, '''<''': op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
lowercase_       :						Optional[Any]     					=	[
    '''nnodes''',
    '''nproc_per_node''',
    '''rdzv_backend''',
    '''rdzv_endpoint''',
    '''rdzv_id''',
    '''rdzv_conf''',
    '''standalone''',
    '''max_restarts''',
    '''monitor_interval''',
    '''start_method''',
    '''role''',
    '''module''',
    '''m''',
    '''no_python''',
    '''run_path''',
    '''log_dir''',
    '''r''',
    '''redirects''',
    '''t''',
    '''tee''',
    '''node_rank''',
    '''master_addr''',
    '''master_port''',
]

lowercase_       :						Any     					=	['''DEEPSPEED''', '''MULTI_GPU''', '''FSDP''', '''MEGATRON_LM''']
lowercase_       :						Any     					=	['''DEEPSPEED''', '''MULTI_XPU''', '''FSDP''']





"""simple docstring"""
import fire

from transformers import AutoConfig, AutoModelForSeqaSeqLM, AutoTokenizer





def    _lowerCAmelCase    (     lowerCamelCase__							:							str,						lowerCamelCase__							:							str,						**lowerCamelCase__							:							Optional[Any]				)  ->    Union[str, Any]:
  _SCREAMING_SNAKE_CASE   :				Dict							    = AutoConfig.from_pretrained(lowerCamelCase__,						**lowerCamelCase__				)
  _SCREAMING_SNAKE_CASE   :				List[str]							    = AutoModelForSeqaSeqLM.from_config(lowerCamelCase__				)
  model.save_pretrained(lowerCamelCase__				)
  AutoTokenizer.from_pretrained(lowerCamelCase__				).save_pretrained(lowerCamelCase__				)
  return model


if __name__ == "__main__":
      fire.Fire(save_randomly_initialized_version)



