





import os
import sys

__lowerCamelCase	:					Optional[int]			  =					os.path.join(os.path.dirname(__file__), """src""")
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__lowerCamelCase	:					List[Any]			  =					[
    """torch""",
    """numpy""",
    """tokenizers""",
    """filelock""",
    """requests""",
    """tqdm""",
    """regex""",
    """sentencepiece""",
    """sacremoses""",
    """importlib_metadata""",
    """huggingface_hub""",
]



@add_start_docstrings(AutoConfig.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Optional[Any]:
 return AutoConfig.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoTokenizer.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Tuple:
 return AutoTokenizer.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoModel.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Any:
 return AutoModel.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoModelForCausalLM.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Tuple:
 return AutoModelForCausalLM.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoModelForMaskedLM.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Union[str, Any]:
 return AutoModelForMaskedLM.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoModelForSequenceClassification.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			str:
 return AutoModelForSequenceClassification.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)



@add_start_docstrings(AutoModelForQuestionAnswering.__doc__					)
def 		A_    (					*_lowerCAmelCase							,       **_lowerCAmelCase					)						->			Union[str, Any]:
 return AutoModelForQuestionAnswering.from_pretrained(*_lowerCAmelCase							,       **_lowerCAmelCase					)







from __future__ import annotations



def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase					)						->			list[str]:
 if partitions <= 0:
  raise ValueError("partitions must be a positive number!"					)
 if partitions > number_of_bytes:
  raise ValueError("partitions can not > number_of_bytes!"					)
 UpperCamelCase     : str	     =       number_of_bytes // partitions
 UpperCamelCase     : List[Any]	     =       []
 for i in range(_lowerCAmelCase					):
  UpperCamelCase     : Optional[Any]	     =       i * bytes_per_partition + 1
  UpperCamelCase     : Any	     =       (
      number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
  )
  allocation_list.append(F"""{start_bytes}-{end_bytes}"""					)
 return allocation_list


if __name__ == "__main__":
    import doctest

    doctest.testmod()
