





'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase					:		int		=							logging.get_logger(__name__)

UpperCAmelCase					:		Dict		=							{
    'microsoft/trocr-base-handwritten': (
        'https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}





class lowerCamelCase						(_UpperCAmelCase					):
  _lowercase  :	Optional[Any]       					=				"""trocr"""
  _lowercase  :	Union[str, Any]       					=				["""past_key_values"""]
  _lowercase  :	str       					=				{
      """num_attention_heads""": """decoder_attention_heads""",
      """hidden_size""": """d_model""",
      """num_hidden_layers""": """decoder_layers""",
  }







  def __init__(		self     ,     lowercase__=50_265     ,     lowercase__=1_024     ,     lowercase__=12     ,     lowercase__=16     ,     lowercase__=4_096     ,     lowercase__="gelu"     ,     lowercase__=512     ,     lowercase__=0.1     ,     lowercase__=0.0     ,     lowercase__=0.0     ,     lowercase__=2     ,     lowercase__=0.02     ,     lowercase__=0.0     ,     lowercase__=True     ,     lowercase__=False     ,     lowercase__=True     ,     lowercase__=True     ,     lowercase__=1     ,     lowercase__=0     ,     lowercase__=2     ,     **lowercase__     ,     )		->						Union[str, Any]:






        """simple docstring"""





        _snake_case		:	Union[str, Any]					     =     vocab_size
        _snake_case		:	int					     =     d_model
        _snake_case		:	Any					     =     decoder_layers
        _snake_case		:	str					     =     decoder_attention_heads
        _snake_case		:	Optional[Any]					     =     decoder_ffn_dim
        _snake_case		:	str					     =     activation_function
        _snake_case		:	Dict					     =     max_position_embeddings
        _snake_case		:	Dict					     =     dropout
        _snake_case		:	Optional[int]					     =     attention_dropout
        _snake_case		:	Dict					     =     activation_dropout
        _snake_case		:	Tuple					     =     init_std
        _snake_case		:	Optional[int]					     =     decoder_layerdrop
        _snake_case		:	Optional[int]					     =     use_cache
        _snake_case		:	Union[str, Any]					     =     scale_embedding
        _snake_case		:	Optional[Any]					     =     use_learned_position_embeddings
        _snake_case		:	Dict					     =     layernorm_embedding

        super().__init__(
            pad_token_id=lowercase__     ,     bos_token_id=lowercase__     ,     eos_token_id=lowercase__     ,     decoder_start_token_id=lowercase__     ,     **lowercase__     ,     )











'''simple docstring'''

from argparse import ArgumentParser

from .add_new_model import AddNewModelCommand
from .add_new_model_like import AddNewModelLikeCommand
from .convert import ConvertCommand
from .download import DownloadCommand
from .env import EnvironmentCommand
from .lfs import LfsCommands
from .pt_to_tf import PTtoTFCommand
from .run import RunCommand
from .serving import ServeCommand
from .user import UserCommands




def    _a    (							):





      """simple docstring"""



      _snake_case		:	List[Any]					     =     ArgumentParser('''Transformers CLI tool'''			,      usage='''transformers-cli <command> [<args>]'''	)
      _snake_case		:	List[str]					     =     parser.add_subparsers(help='''transformers-cli command helpers'''	)

      # Register commands
      ConvertCommand.register_subcommand(lowerCAmelCase_	)
      DownloadCommand.register_subcommand(lowerCAmelCase_	)
      EnvironmentCommand.register_subcommand(lowerCAmelCase_	)
      RunCommand.register_subcommand(lowerCAmelCase_	)
      ServeCommand.register_subcommand(lowerCAmelCase_	)
      UserCommands.register_subcommand(lowerCAmelCase_	)
      AddNewModelCommand.register_subcommand(lowerCAmelCase_	)
      AddNewModelLikeCommand.register_subcommand(lowerCAmelCase_	)
      LfsCommands.register_subcommand(lowerCAmelCase_	)
      PTtoTFCommand.register_subcommand(lowerCAmelCase_	)

      # Let's go
      _snake_case		:	str					     =     parser.parse_args()

      if not hasattr(lowerCAmelCase_			,      '''func'''	):
            parser.print_help()
            exit(1	)

      # Run
      _snake_case		:	Union[str, Any]					     =     args.func(lowerCAmelCase_	)
      service.run()


if __name__ == "__main__":
   main()


