
import argparse

from transformers import BigBirdConfig, BigBirdForPreTraining, BigBirdForQuestionAnswering, load_tf_weights_in_big_bird
from transformers.utils import logging


logging.set_verbosity_info()
def 					lowerCamelCase__		(				_lowerCamelCase			,		_lowerCamelCase			,		_lowerCamelCase			,		_lowerCamelCase  )						->Union[str, Any]:
 # Initialise PyTorch model
 _UpperCAmelCase 				=BigBirdConfig.from_json_file(UpperCamelCase__  )
 print(F"Building PyTorch model from configuration: {config}"  )

 if is_trivia_qa:
  _UpperCAmelCase 				=BigBirdForQuestionAnswering(UpperCamelCase__  )
 else:
  _UpperCAmelCase 				=BigBirdForPreTraining(UpperCamelCase__  )

 # Load weights from tf checkpoint
 load_tf_weights_in_big_bird(UpperCamelCase__			,		UpperCamelCase__			,		is_trivia_qa=UpperCamelCase__  )

 # Save pytorch-model
 print(F"Save PyTorch model to {pytorch_dump_path}"  )
 model.save_pretrained(UpperCamelCase__  )


if __name__ == "__main__":
       snake_case__      :		Optional[int]				=       argparse.ArgumentParser()
       # Required parameters
       parser.add_argument(
           '--tf_checkpoint_path', default=None, type=str, required=True, help='Path to the TensorFlow checkpoint path.'
       )
       parser.add_argument(
           '--big_bird_config_file',
           default=None,
           type=str,
           required=True,
           help=(
               'The config json file corresponding to the pre-trained BERT model. \n'
               'This specifies the model architecture.'
           ),
       )
       parser.add_argument(
           '--pytorch_dump_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
       )
       parser.add_argument(
           '--is_trivia_qa', action='store_true', help='Whether to convert a model with a trivia_qa head.'
       )
       snake_case__      :		Tuple				=       parser.parse_args()
       convert_tf_checkpoint_to_pytorch(
           args.tf_checkpoint_path, args.big_bird_config_file, args.pytorch_dump_path, args.is_trivia_qa
       )












import itertools
import math


def       UpperCamelCase__(			UpperCamelCase__     :			int    )->bool:

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or number % 2 == 0 or number % 3 == 0:
              # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
              return False

       # All primes number are in format of 6k +/- 1
       for i in range(5					,	int(math.sqrt(UpperCamelCase__    ) + 1    )					,	6    ):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True


def       UpperCamelCase__(			)->Tuple:
       A__		   =		2
       while True:
              if is_prime(UpperCamelCase__    ):
                     yield num
              num += 1


def       UpperCamelCase__(			UpperCamelCase__     :			int = 1_00_01    )->int:
       return next(itertools.islice(prime_generator()					,	nth - 1					,	UpperCamelCase__    )    )


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





