






import sys

sys.set_int_max_str_digits(0)  # type: ignore







def 			_SCREAMING_SNAKE_CASE    (       a  )				->				bool:
					__A     :						Optional[int]          =    [0] * 11
					__A     :						List[Any]          =    [0] * 11

					# mark last 9 numbers
					for _ in range(9  ):
										__A     :						Dict          =    1
										__A     :						Any          =    number // 10
					# flag
					__A     :						List[Any]          =    True

					# check last 9 numbers for pandigitality

					for x in range(9  ):
										if not check_last[x + 1]:
															__A     :						str          =    False
					if not f:
										return f

					# mark first 9 numbers
					__A     :						List[str]          =    int(str(_lowerCamelCase  )[:9]  )

					for _ in range(9  ):
										__A     :						List[str]          =    1
										__A     :						List[str]          =    number // 10

					# check first 9 numbers for pandigitality

					for x in range(9  ):
										if not check_front[x + 1]:
															__A     :						Optional[Any]          =    False
					return f







def 			_SCREAMING_SNAKE_CASE    (       a  )				->				bool:
					__A     :						Dict          =    [0] * 11

					# mark last 9 numbers
					for _ in range(9  ):
										__A     :						Union[str, Any]          =    1
										__A     :						str          =    number // 10
					# flag
					__A     :						Dict          =    True

					# check last 9 numbers for pandigitality

					for x in range(9  ):
										if not check_last[x + 1]:
															__A     :						Tuple          =    False
					return f







def 			_SCREAMING_SNAKE_CASE    (       )				->				int:
					__A     :						Union[str, Any]          =    1
					__A     :						Tuple          =    1
					__A     :						int          =    2
					# temporary Fibonacci numbers

					__A     :						Optional[int]          =    1
					__A     :						Optional[Any]          =    1
					__A     :						List[Any]          =    2
					# temporary Fibonacci numbers mod 1e9

					# mod m=1e9, done for fast optimisation
					__A     :						str          =    [0] * 1_00_00_00
					__A     :						int          =    10_00_00_00_00

					for x in range(1_00_00_00  ):
										__A     :						List[str]          =    (aa + ba) % m
										__A     :						Dict          =    ba % m
										__A     :						Optional[int]          =    ca % m
										if checka(_lowerCamelCase  ):
															__A     :						List[Any]          =    1

					for x in range(1_00_00_00  ):
										__A     :						int          =    a + b
										__A     :						Any          =    b
										__A     :						List[Any]          =    c
										# perform check only if in tocheck
										if tocheck[x + 3] and check(_lowerCamelCase  ):
															return x + 3  # first 2 already done
					return -1


if __name__ == "__main__":
				print(F"""{solution() = }""")











import argparse

import torch

from transformers import HubertConfig, HubertForSequenceClassification, WavaVecaFeatureExtractor, logging


logging.set_verbosity_info()
UpperCAmelCase						:       Tuple        =					logging.get_logger(__name__)

UpperCAmelCase						:       List[Any]        =					['''UtteranceLevel''']







@torch.no_grad()
def 			_SCREAMING_SNAKE_CASE    (       a ,						a ,						a ,						a  )				->				List[str]:
					__A     :						Any          =    torch.load(a ,						map_location='cpu'  )
					if checkpoint["Config"]["downstream_expert"]["modelrc"]["select"] not in SUPPORTED_MODELS:
										raise NotImplementedError(F"""The supported s3prl models are {SUPPORTED_MODELS}"""  )

					__A     :						Dict          =    checkpoint['Downstream']

					__A     :						Optional[Any]          =    HubertConfig.from_pretrained(a  )
					__A     :						Tuple          =    HubertForSequenceClassification.from_pretrained(a ,						config=a  )
					__A     :						str          =    WavaVecaFeatureExtractor.from_pretrained(
					    a ,						return_attention_mask=a ,						do_normalize=a  )

					if hf_congfig.use_weighted_layer_sum:
										__A     :						Optional[Any]          =    checkpoint['Featurizer']['weights']

					__A     :						Dict          =    downstream_dict['projector.weight']
					__A     :						int          =    downstream_dict['projector.bias']
					__A     :						List[Any]          =    downstream_dict['model.post_net.linear.weight']
					__A     :						int          =    downstream_dict['model.post_net.linear.bias']

					hf_feature_extractor.save_pretrained(a  )
					hf_model.save_pretrained(a  )


if __name__ == "__main__":
				UpperCAmelCase						:       Dict        =					argparse.ArgumentParser()
				parser.add_argument(
				    '''--base_model_name''', default=None, type=str, help='''Name of the huggingface pretrained base model.'''
				)
				parser.add_argument('''--config_path''', default=None, type=str, help='''Path to the huggingface classifier config.''')
				parser.add_argument('''--checkpoint_path''', default=None, type=str, help='''Path to the s3prl checkpoint.''')
				parser.add_argument('''--model_dump_path''', default=None, type=str, help='''Path to the final converted model.''')
				UpperCAmelCase						:       Dict        =					parser.parse_args()
				convert_saprl_checkpoint(args.base_model_name, args.config_path, args.checkpoint_path, args.model_dump_path)




