

'''simple docstring'''



from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__snake_case			:     List[Any]										=      logging.get_logger(__name__)

__snake_case			:     List[str]										=      {
    'google/bit-50': 'https://huggingface.co/google/bit-50/resolve/main/config.json',
}



class lowerCamelCase			(  lowercase_	,						lowercase_						):



			'''simple docstring'''






			__snake_case        =	'bit'
			__snake_case        =	['preactivation', 'bottleneck']
			__snake_case        =	['SAME', 'VALID']


			def __init__(				self	:						List[str]		,      lowerCAmelCase_	:						int=3		,      lowerCAmelCase_	:						Tuple=64		,      lowerCAmelCase_	:						Dict=[2_56, 5_12, 10_24, 20_48]		,      lowerCAmelCase_	:						Any=[3, 4, 6, 3]		,      lowerCAmelCase_	:						Dict="preactivation"		,      lowerCAmelCase_	:						Union[str, Any]="relu"		,      lowerCAmelCase_	:						int=None		,      lowerCAmelCase_	:						Tuple=32		,      lowerCAmelCase_	:						Union[str, Any]=0.0		,      lowerCAmelCase_	:						int=False		,      lowerCAmelCase_	:						Dict=32		,      lowerCAmelCase_	:						int=1		,      lowerCAmelCase_	:						List[Any]=None		,      lowerCAmelCase_	:						List[Any]=None		,      **lowerCAmelCase_	:						List[Any]		,      )      ->		int:





									'''simple docstring'''
									super().__init__(**lowerCAmelCase_			)
									if layer_type not in self.layer_types:
															raise ValueError(f"layer_type={layer_type} is not one of {','.join(self.layer_types			)}"			)
									if global_padding is not None:
															if global_padding.upper() in self.supported_padding:
																					A__					:       Tuple     =global_padding.upper()
															else:
																					raise ValueError(f"Padding strategy {global_padding} not supported"			)
									A__					:       int     =num_channels
									A__					:       List[Any]     =embedding_size
									A__					:       Optional[Any]     =hidden_sizes
									A__					:       Any     =depths
									A__					:       Tuple     =layer_type
									A__					:       List[Any]     =hidden_act
									A__					:       int     =global_padding
									A__					:       str     =num_groups
									A__					:       List[str]     =drop_path_rate
									A__					:       Tuple     =embedding_dynamic_padding
									A__					:       List[str]     =output_stride
									A__					:       Union[str, Any]     =width_factor

									A__					:       List[str]     =["""stem"""] + [f"stage{idx}" for idx in range(1		,      len(lowerCAmelCase_			) + 1			)]
									A__   ,						A__					:       Any     =get_aligned_output_features_output_indices(
									    out_features=lowerCAmelCase_		,      out_indices=lowerCAmelCase_		,      stage_names=self.stage_names			)




'''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 						__lowerCamelCase	(       )	->							List[Any]:






						"""simple docstring"""





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

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

						# Let's go
						A__					:       List[str]     =parser.parse_args()

						if not hasattr(__snake_case,		"""func"""	):
												parser.print_help()
												exit(1	)

						# Run
						A__					:       Optional[Any]     =args.func(__snake_case	)
						service.run()


if __name__ == "__main__":
		main()

