

'''simple docstring'''




import argparse

import torch

from transformers import (
    EncodecConfig,
    EncodecFeatureExtractor,
    EncodecModel,
    logging,
)


# checkpoints downloaded from:
# https://dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th
# https://huggingface.co/facebook/musicgen-small/resolve/main/compression_state_dict.bin
# https://dl.fbaipublicfiles.com/encodec/v0/encodec_48khz-7e698e3e.th


logging.set_verbosity_info()
_lowerCAmelCase            =		logging.get_logger("transformers.models.encodec")

_lowerCAmelCase            =		{
    """quantizer.vq.layers.*._codebook.inited""": """quantizer.layers.*.codebook.inited""",
    """quantizer.vq.layers.*._codebook.cluster_size""": """quantizer.layers.*.codebook.cluster_size""",
    """quantizer.vq.layers.*._codebook.embed""": """quantizer.layers.*.codebook.embed""",
    """quantizer.vq.layers.*._codebook.embed_avg""": """quantizer.layers.*.codebook.embed_avg""",
}
_lowerCAmelCase            =		{
    """encoder.model.0.conv.conv""": """encoder.layers.0.conv""",
    """encoder.model.1.block.1.conv.conv""": """encoder.layers.1.block.1.conv""",
    """encoder.model.1.block.3.conv.conv""": """encoder.layers.1.block.3.conv""",
    """encoder.model.1.shortcut.conv.conv""": """encoder.layers.1.shortcut.conv""",
    """encoder.model.3.conv.conv""": """encoder.layers.3.conv""",
    """encoder.model.4.block.1.conv.conv""": """encoder.layers.4.block.1.conv""",
    """encoder.model.4.block.3.conv.conv""": """encoder.layers.4.block.3.conv""",
    """encoder.model.4.shortcut.conv.conv""": """encoder.layers.4.shortcut.conv""",
    """encoder.model.6.conv.conv""": """encoder.layers.6.conv""",
    """encoder.model.7.block.1.conv.conv""": """encoder.layers.7.block.1.conv""",
    """encoder.model.7.block.3.conv.conv""": """encoder.layers.7.block.3.conv""",
    """encoder.model.7.shortcut.conv.conv""": """encoder.layers.7.shortcut.conv""",
    """encoder.model.9.conv.conv""": """encoder.layers.9.conv""",
    """encoder.model.10.block.1.conv.conv""": """encoder.layers.10.block.1.conv""",
    """encoder.model.10.block.3.conv.conv""": """encoder.layers.10.block.3.conv""",
    """encoder.model.10.shortcut.conv.conv""": """encoder.layers.10.shortcut.conv""",
    """encoder.model.12.conv.conv""": """encoder.layers.12.conv""",
    """encoder.model.13.lstm""": """encoder.layers.13.lstm""",
    """encoder.model.15.conv.conv""": """encoder.layers.15.conv""",
}
_lowerCAmelCase            =		{
    """encoder.model.0.conv.norm""": """encoder.layers.0.norm""",
    """encoder.model.1.block.1.conv.norm""": """encoder.layers.1.block.1.norm""",
    """encoder.model.1.block.3.conv.norm""": """encoder.layers.1.block.3.norm""",
    """encoder.model.1.shortcut.conv.norm""": """encoder.layers.1.shortcut.norm""",
    """encoder.model.3.conv.norm""": """encoder.layers.3.norm""",
    """encoder.model.4.block.1.conv.norm""": """encoder.layers.4.block.1.norm""",
    """encoder.model.4.block.3.conv.norm""": """encoder.layers.4.block.3.norm""",
    """encoder.model.4.shortcut.conv.norm""": """encoder.layers.4.shortcut.norm""",
    """encoder.model.6.conv.norm""": """encoder.layers.6.norm""",
    """encoder.model.7.block.1.conv.norm""": """encoder.layers.7.block.1.norm""",
    """encoder.model.7.block.3.conv.norm""": """encoder.layers.7.block.3.norm""",
    """encoder.model.7.shortcut.conv.norm""": """encoder.layers.7.shortcut.norm""",
    """encoder.model.9.conv.norm""": """encoder.layers.9.norm""",
    """encoder.model.10.block.1.conv.norm""": """encoder.layers.10.block.1.norm""",
    """encoder.model.10.block.3.conv.norm""": """encoder.layers.10.block.3.norm""",
    """encoder.model.10.shortcut.conv.norm""": """encoder.layers.10.shortcut.norm""",
    """encoder.model.12.conv.norm""": """encoder.layers.12.norm""",
    """encoder.model.15.conv.norm""": """encoder.layers.15.norm""",
}
_lowerCAmelCase            =		{
    """decoder.model.0.conv.conv""": """decoder.layers.0.conv""",
    """decoder.model.1.lstm""": """decoder.layers.1.lstm""",
    """decoder.model.3.convtr.convtr""": """decoder.layers.3.conv""",
    """decoder.model.4.block.1.conv.conv""": """decoder.layers.4.block.1.conv""",
    """decoder.model.4.block.3.conv.conv""": """decoder.layers.4.block.3.conv""",
    """decoder.model.4.shortcut.conv.conv""": """decoder.layers.4.shortcut.conv""",
    """decoder.model.6.convtr.convtr""": """decoder.layers.6.conv""",
    """decoder.model.7.block.1.conv.conv""": """decoder.layers.7.block.1.conv""",
    """decoder.model.7.block.3.conv.conv""": """decoder.layers.7.block.3.conv""",
    """decoder.model.7.shortcut.conv.conv""": """decoder.layers.7.shortcut.conv""",
    """decoder.model.9.convtr.convtr""": """decoder.layers.9.conv""",
    """decoder.model.10.block.1.conv.conv""": """decoder.layers.10.block.1.conv""",
    """decoder.model.10.block.3.conv.conv""": """decoder.layers.10.block.3.conv""",
    """decoder.model.10.shortcut.conv.conv""": """decoder.layers.10.shortcut.conv""",
    """decoder.model.12.convtr.convtr""": """decoder.layers.12.conv""",
    """decoder.model.13.block.1.conv.conv""": """decoder.layers.13.block.1.conv""",
    """decoder.model.13.block.3.conv.conv""": """decoder.layers.13.block.3.conv""",
    """decoder.model.13.shortcut.conv.conv""": """decoder.layers.13.shortcut.conv""",
    """decoder.model.15.conv.conv""": """decoder.layers.15.conv""",
}
_lowerCAmelCase            =		{
    """decoder.model.0.conv.norm""": """decoder.layers.0.norm""",
    """decoder.model.3.convtr.norm""": """decoder.layers.3.norm""",
    """decoder.model.4.block.1.conv.norm""": """decoder.layers.4.block.1.norm""",
    """decoder.model.4.block.3.conv.norm""": """decoder.layers.4.block.3.norm""",
    """decoder.model.4.shortcut.conv.norm""": """decoder.layers.4.shortcut.norm""",
    """decoder.model.6.convtr.norm""": """decoder.layers.6.norm""",
    """decoder.model.7.block.1.conv.norm""": """decoder.layers.7.block.1.norm""",
    """decoder.model.7.block.3.conv.norm""": """decoder.layers.7.block.3.norm""",
    """decoder.model.7.shortcut.conv.norm""": """decoder.layers.7.shortcut.norm""",
    """decoder.model.9.convtr.norm""": """decoder.layers.9.norm""",
    """decoder.model.10.block.1.conv.norm""": """decoder.layers.10.block.1.norm""",
    """decoder.model.10.block.3.conv.norm""": """decoder.layers.10.block.3.norm""",
    """decoder.model.10.shortcut.conv.norm""": """decoder.layers.10.shortcut.norm""",
    """decoder.model.12.convtr.norm""": """decoder.layers.12.norm""",
    """decoder.model.13.block.1.conv.norm""": """decoder.layers.13.block.1.norm""",
    """decoder.model.13.block.3.conv.norm""": """decoder.layers.13.block.3.norm""",
    """decoder.model.13.shortcut.conv.norm""": """decoder.layers.13.shortcut.norm""",
    """decoder.model.15.conv.norm""": """decoder.layers.15.norm""",
}
_lowerCAmelCase            =		{
    **MAPPING_QUANTIZER,
    **MAPPING_ENCODER,
    **MAPPING_DECODER,
}
_lowerCAmelCase            =		{
    **MAPPING_QUANTIZER,
    **MAPPING_ENCODER,
    **MAPPING_ENCODER_48K,
    **MAPPING_DECODER,
    **MAPPING_DECODER_48K,
}
_lowerCAmelCase            =		[]
_lowerCAmelCase            =		[]




def 		UpperCamelCase			(					a						,		a						,		a						,		a						,		a					) ->      List[str]:






     '''simple docstring'''

     for attribute in key.split('''.'''					):
          __magic_name__		  =							getattr(lowercase_						,		lowercase_					)

     if weight_type is not None:
          __magic_name__		  =							getattr(lowercase_						,		lowercase_					).shape
     else:
          __magic_name__		  =							hf_pointer.shape

     if hf_shape != value.shape:
          raise ValueError(
              F'''Shape of hf {key + "." + weight_type if weight_type is not None else ""} is {hf_shape}, but should be'''
              F''' {value.shape} for {full_name}'''					)

     if weight_type == "weight":
          __magic_name__		  =							value
     elif weight_type == "weight_g":
          __magic_name__		  =							value
     elif weight_type == "weight_v":
          __magic_name__		  =							value
     elif weight_type == "bias":
          __magic_name__		  =							value
     elif weight_type == "running_mean":
          __magic_name__		  =							value
     elif weight_type == "running_var":
          __magic_name__		  =							value
     elif weight_type == "num_batches_tracked":
          __magic_name__		  =							value
     elif weight_type == "weight_ih_l0":
          __magic_name__		  =							value
     elif weight_type == "weight_hh_l0":
          __magic_name__		  =							value
     elif weight_type == "bias_ih_l0":
          __magic_name__		  =							value
     elif weight_type == "bias_hh_l0":
          __magic_name__		  =							value
     elif weight_type == "weight_ih_l1":
          __magic_name__		  =							value
     elif weight_type == "weight_hh_l1":
          __magic_name__		  =							value
     elif weight_type == "bias_ih_l1":
          __magic_name__		  =							value
     elif weight_type == "bias_hh_l1":
          __magic_name__		  =							value
     else:
          __magic_name__		  =							value

     logger.info(F'''{key + ("." + weight_type if weight_type is not None else "")} was initialized from {full_name}.'''					)




def 		UpperCamelCase			(					a						,		a					) ->      int:






     '''simple docstring'''

     for key in ignore_keys:
          if key.endswith('''.*'''					):
               if name.startswith(key[:-1]					):
                    return True
          elif ".*." in key:
               __magic_name__  ,    __magic_name__		  =							key.split('''.*.'''					)
               if prefix in name and suffix in name:
                    return True
          elif key in name:
               return True
     return False




def 		UpperCamelCase			(					a						,		a						,		a					) ->      Union[str, Any]:






     '''simple docstring'''
     __magic_name__		  =							[]

     if model_name == "encodec_24khz" or "encodec_32khz":
          __magic_name__		  =							MAPPING_24K
     elif model_name == "encodec_48khz":
          __magic_name__		  =							MAPPING_48K
     else:
          raise ValueError(F'''Unsupported model: {model_name}'''					)

     for name, value in orig_dict.items():
          if should_ignore(lowercase_						,		lowercase_					):
               logger.info(F'''{name} was ignored'''					)
               continue

          __magic_name__		  =							False
          for key, mapped_key in MAPPING.items():
               if "*" in key:
                    __magic_name__  ,    __magic_name__		  =							key.split('''.*.'''					)
                    if prefix in name and suffix in name:
                         __magic_name__		  =							suffix

               if key in name:
                    # HACK otherwise .embed gets initialized with .embed_avg too
                    if key.endswith('''embed'''					) and name.endswith('''embed_avg'''					):
                         continue

                    __magic_name__		  =							True
                    if "*" in mapped_key:
                         __magic_name__		  =							name.split(lowercase_					)[0].split('''.'''					)[-2]
                         __magic_name__		  =							mapped_key.replace('''*'''						,		lowercase_					)
                    if "weight_g" in name:
                         __magic_name__		  =							'''weight_g'''
                    elif "weight_v" in name:
                         __magic_name__		  =							'''weight_v'''
                    elif "weight_ih_l0" in name:
                         __magic_name__		  =							'''weight_ih_l0'''
                    elif "weight_hh_l0" in name:
                         __magic_name__		  =							'''weight_hh_l0'''
                    elif "bias_ih_l0" in name:
                         __magic_name__		  =							'''bias_ih_l0'''
                    elif "bias_hh_l0" in name:
                         __magic_name__		  =							'''bias_hh_l0'''
                    elif "weight_ih_l1" in name:
                         __magic_name__		  =							'''weight_ih_l1'''
                    elif "weight_hh_l1" in name:
                         __magic_name__		  =							'''weight_hh_l1'''
                    elif "bias_ih_l1" in name:
                         __magic_name__		  =							'''bias_ih_l1'''
                    elif "bias_hh_l1" in name:
                         __magic_name__		  =							'''bias_hh_l1'''
                    elif "bias" in name:
                         __magic_name__		  =							'''bias'''
                    elif "weight" in name:
                         __magic_name__		  =							'''weight'''
                    elif "running_mean" in name:
                         __magic_name__		  =							'''running_mean'''
                    elif "running_var" in name:
                         __magic_name__		  =							'''running_var'''
                    elif "num_batches_tracked" in name:
                         __magic_name__		  =							'''num_batches_tracked'''
                    else:
                         __magic_name__		  =							None
                    set_recursively(lowercase_						,		lowercase_						,		lowercase_						,		lowercase_						,		lowercase_					)
               continue
          if not is_used:
               unused_weights.append(lowercase_					)

     logger.warning(F'''Unused weights: {unused_weights}'''					)




@torch.no_grad()
def 		UpperCamelCase			(					a						,		a						,		a						,		a=None						,		a=None						,		) ->      Optional[Any]:






     '''simple docstring'''

     if config_path is not None:
          __magic_name__		  =							EncodecConfig.from_pretrained(lowercase_					)
     else:
          __magic_name__		  =							EncodecConfig()

     if model_name == "encodec_24khz":
          pass  # config is already correct
     elif model_name == "encodec_32khz":
          __magic_name__		  =							[8, 5, 4, 4]
          __magic_name__		  =							[2.2]
          __magic_name__		  =							64
          __magic_name__		  =							3_2000
          __magic_name__		  =							2048
          __magic_name__		  =							False
          __magic_name__		  =							False
          __magic_name__		  =							False
     elif model_name == "encodec_48khz":
          __magic_name__		  =							[8, 5, 4, 2]
          __magic_name__		  =							[3.0, 6.0, 12.0, 24.0]
          __magic_name__		  =							4_8000
          __magic_name__		  =							2
          __magic_name__		  =							False
          __magic_name__		  =							'''time_group_norm'''
          __magic_name__		  =							True
          __magic_name__		  =							1.0
          __magic_name__		  =							0.01
     else:
          raise ValueError(F'''Unknown model name: {model_name}'''					)

     __magic_name__		  =							EncodecModel(lowercase_					)

     __magic_name__		  =							EncodecFeatureExtractor(
         feature_size=config.audio_channels						,		sampling_rate=config.sampling_rate						,		chunk_length_s=config.chunk_length_s						,		overlap=config.overlap						,		)
     feature_extractor.save_pretrained(lowercase_					)

     __magic_name__		  =							torch.load(lowercase_					)
     if "best_state" in original_checkpoint:
          # we might have a training state saved, in which case discard the yaml results and just retain the weights
          __magic_name__		  =							original_checkpoint['''best_state''']
     recursively_load_weights(lowercase_						,		lowercase_						,		lowercase_					)
     model.save_pretrained(lowercase_					)

     if repo_id:
          print('''Pushing to the hub...'''					)
          feature_extractor.push_to_hub(lowercase_					)
          model.push_to_hub(lowercase_					)


if __name__ == "__main__":
      _lowerCAmelCase            =		argparse.ArgumentParser()
      parser.add_argument(
          "--model",
          default="encodec_24khz",
          type=str,
          help="The model to convert. Should be one of 'encodec_24khz', 'encodec_32khz', 'encodec_48khz'.",
      )
      parser.add_argument("--checkpoint_path", required=True, default=None, type=str, help="Path to original checkpoint")
      parser.add_argument("--config_path", default=None, type=str, help="Path to hf config.json of model to convert")
      parser.add_argument(
          "--pytorch_dump_folder_path", required=True, default=None, type=str, help="Path to the output PyTorch model."
      )
      parser.add_argument(
          "--push_to_hub", default=None, type=str, help="Where to upload the converted model on the 🤗 hub."
      )

      _lowerCAmelCase            =		parser.parse_args()
      convert_checkpoint(
          args.model,
          args.checkpoint_path,
          args.pytorch_dump_folder_path,
          args.config_path,
          args.push_to_hub,
      )












import unittest

from transformers import JukeboxTokenizer
from transformers.testing_utils import require_torch


class 							UpperCamelCase_       (					unittest.TestCase	):

    '''simple docstring'''






    UpperCAmelCase__				    = JukeboxTokenizer
    UpperCAmelCase__				    = {
        '''artist''': '''Zac Brown Band''',
        '''genres''': '''Country''',
        '''lyrics''': '''I met a traveller from an antique land,
        Who said "Two vast and trunkless legs of stone
        Stand in the desert. . . . Near them, on the sand,
        Half sunk a shattered visage lies, whose frown,
        And wrinkled lip, and sneer of cold command,
        Tell that its sculptor well those passions read
        Which yet survive, stamped on these lifeless things,
        The hand that mocked them, and the heart that fed;
        And on the pedestal, these words appear:
        My name is Ozymandias, King of Kings;
        Look on my Works, ye Mighty, and despair!
        Nothing beside remains. Round the decay
        Of that colossal Wreck, boundless and bare
        The lone and level sands stretch far away
        ''',
    }


    @require_torch
    def 			SCREAMING_SNAKE_CASE				(     self :      Dict)		->int:





           '''simple docstring'''

           import torch

           A__ 					=       JukeboxTokenizer.from_pretrained('''openai/jukebox-1b-lyrics''')
           A__ 					=       tokenizer(**self.metas)['''input_ids''']
           # fmt: off
           A__ 					=       [
               torch.tensor([[
                   0, 0, 0, 7_169, 507, 9, 76, 39, 31, 46, 76, 27,
                   76, 46, 44, 27, 48, 31, 38, 38, 31, 44, 76, 32,
                   44, 41, 39, 76, 27, 40, 76, 27, 40, 46, 35, 43,
                   47, 31, 76, 38, 27, 40, 30, 64, 78, 76, 76, 76,
                   76, 76, 76, 76, 76, 23, 34, 41, 76, 45, 27, 35,
                   30, 76, 71, 20, 49, 41, 76, 48, 27, 45, 46, 76,
                   27, 40, 30, 76, 46, 44, 47, 40, 37, 38, 31, 45,
                   45, 76, 38, 31, 33, 45, 76, 41, 32, 76, 45, 46,
                   41, 40, 31, 78, 76, 76, 76, 76, 76, 76, 76, 76,
                   19, 46, 27, 40, 30, 76, 35, 40, 76, 46, 34, 31,
                   76, 30, 31, 45, 31, 44, 46, 63, 76, 63, 76, 63,
                   76, 63, 76, 14, 31, 27, 44, 76, 46, 34, 31, 39,
                   64, 76, 41, 40, 76, 46, 34, 31, 76, 45, 27, 40,
                   30, 64, 78, 76, 76, 76, 76, 76, 76, 76, 76, 8,
                   27, 38, 32, 76, 45, 47, 40, 37, 76, 27, 76, 45,
                   34, 27, 46, 46, 31, 44, 31, 30, 76, 48, 35, 45,
                   27, 33, 31, 76, 38, 35, 31, 45, 64, 76, 49, 34,
                   41, 45, 31, 76, 32, 44, 41, 49, 40, 64, 78, 76,
                   76, 76, 76, 76, 76, 76, 76, 1, 40, 30, 76, 49,
                   44, 35, 40, 37, 38, 31, 30, 76, 38, 35, 42, 64,
                   76, 27, 40, 30, 76, 45, 40, 31, 31, 44, 76, 41,
                   32, 76, 29, 41, 38, 30, 76, 29, 41, 39, 39, 27,
                   40, 30, 64, 78, 76, 76, 76, 76, 76, 76, 76, 76,
                   20, 31, 38, 38, 76, 46, 34, 27, 46, 76, 35, 46,
                   45, 76, 45, 29, 47, 38, 42, 46, 41, 44, 76, 49,
                   31, 38, 38, 76, 46, 34, 41, 45, 31, 76, 42, 27,
                   45, 45, 35, 41, 40, 45, 76, 44, 31, 27, 30, 78,
                   76, 76, 76, 76, 76, 76, 76, 76, 23, 34, 35, 29,
                   34, 76, 51, 31, 46, 76, 45, 47, 44, 48, 35, 48,
                   31, 64, 76, 45, 46, 27, 39, 42, 31, 30, 76, 41,
                   40, 76, 46, 34, 31, 45, 31, 76, 38, 35, 32, 31,
                   38, 31, 45, 45, 76, 46, 34, 35, 40, 33, 45, 64,
                   78, 76, 76, 76, 76, 76, 76, 76, 76, 20, 34, 31,
                   76, 34, 27, 40, 30, 76, 46, 34, 27, 46, 76, 39,
                   41, 29, 37, 31, 30, 76, 46, 34, 31, 39, 64, 76,
                   27, 40, 30, 76, 46, 34, 31, 76, 34, 31, 27, 44,
                   46, 76, 46, 34, 27, 46, 76, 32, 31, 30, 66, 78,
                   76, 76, 76, 76, 76, 76, 76, 76, 1, 40, 30, 76,
                   41, 40, 76, 46, 34, 31, 76, 42, 31, 30, 31, 45,
                   46, 27, 38, 64, 76, 46, 34, 31, 45, 31, 76, 49,
                   41, 44, 30, 45, 76, 27, 42, 42, 31, 27, 44, 65,
                   78, 76, 76, 76, 76, 76, 76, 76, 76, 13, 51, 76,
                   40, 27, 39, 31, 76, 35, 45, 76, 15, 52, 51, 39,
                   27, 40, 30, 35, 27, 45, 64, 76, 11, 35, 40, 33,
                   76, 41, 32, 76, 11, 35, 40, 33, 45, 66, 78, 76,
                   76, 76, 76, 76, 76, 76, 76, 12, 41, 41, 37, 76,
                   41, 40, 76, 39, 51, 76, 23, 41, 44, 37, 45, 64,
                   76, 51, 31, 76, 13, 35, 33, 34, 46, 51, 64, 76,
                   27, 40, 30, 76, 30, 31, 45, 42, 27, 35, 44, 67,
                   78, 76, 76, 76, 76, 76, 76, 76, 76, 14, 41, 46,
                   34, 35, 40, 33, 76, 28, 31, 45, 35, 30, 31, 76,
                   44, 31, 39, 27, 35, 40, 45, 63, 76, 18, 41, 47,
                   40, 30, 76, 46, 34, 31, 76, 30, 31, 29, 27, 51,
                   78, 76, 76, 76, 76, 76, 76, 76, 76, 15, 32, 76,
                   46, 34, 27, 46, 76, 29, 41, 38, 41, 45, 45, 27,
                   38, 76, 23, 44, 31, 29, 37, 64, 76, 28, 41, 47,
                   40, 30, 38, 31, 45, 45, 76, 27, 40, 30, 76, 28,
                   27, 44, 31, 78, 76, 76, 76, 76, 76, 76, 76, 76,
                   20, 34, 31, 76, 38, 41, 40, 31, 76, 27, 40, 30,
                   76, 38, 31, 48, 31, 38, 76, 45, 27, 40, 30, 45,
                   76, 45, 46, 44, 31, 46, 29, 34, 76, 32, 27, 44,
                   76, 27, 49, 27, 51, 78, 76, 76, 76, 76, 76, 76,
                   76, 76]]),
               torch.tensor([[0, 0, 0, 1_069, 11]]),
               torch.tensor([[0, 0, 0, 1_069, 11]]),
           ]
           # fmt: on
           self.assertTrue(torch.allclose(tokens[0]   ,					EXPECTED_OUTPUT[0]))
           self.assertTrue(torch.allclose(tokens[1]   ,					EXPECTED_OUTPUT[1]))
           self.assertTrue(torch.allclose(tokens[2]   ,					EXPECTED_OUTPUT[2]))





    @require_torch
    def 			SCREAMING_SNAKE_CASE				(     self :      List[str])		->Optional[int]:





           '''simple docstring'''

           import torch

           A__ 					=       JukeboxTokenizer.from_pretrained('''openai/jukebox-5b-lyrics''')
           A__ 					=       tokenizer(**self.metas)['''input_ids''']
           # fmt: off
           A__ 					=       [
               torch.tensor([[
                   0, 0, 0, 1_069, 11, -1, -1, -1, -1, 9, 77, 39,
                   31, 46, 77, 27, 77, 46, 44, 27, 48, 31, 38, 38,
                   31, 44, 77, 32, 44, 41, 39, 77, 27, 40, 77, 27,
                   40, 46, 35, 43, 47, 31, 77, 38, 27, 40, 30, 64,
                   79, 77, 77, 77, 77, 77, 77, 77, 77, 23, 34, 41,
                   77, 45, 27, 35, 30, 77, 72, 20, 49, 41, 77, 48,
                   27, 45, 46, 77, 27, 40, 30, 77, 46, 44, 47, 40,
                   37, 38, 31, 45, 45, 77, 38, 31, 33, 45, 77, 41,
                   32, 77, 45, 46, 41, 40, 31, 79, 77, 77, 77, 77,
                   77, 77, 77, 77, 19, 46, 27, 40, 30, 77, 35, 40,
                   77, 46, 34, 31, 77, 30, 31, 45, 31, 44, 46, 63,
                   77, 63, 77, 63, 77, 63, 77, 14, 31, 27, 44, 77,
                   46, 34, 31, 39, 64, 77, 41, 40, 77, 46, 34, 31,
                   77, 45, 27, 40, 30, 64, 79, 77, 77, 77, 77, 77,
                   77, 77, 77, 8, 27, 38, 32, 77, 45, 47, 40, 37,
                   77, 27, 77, 45, 34, 27, 46, 46, 31, 44, 31, 30,
                   77, 48, 35, 45, 27, 33, 31, 77, 38, 35, 31, 45,
                   64, 77, 49, 34, 41, 45, 31, 77, 32, 44, 41, 49,
                   40, 64, 79, 77, 77, 77, 77, 77, 77, 77, 77, 1,
                   40, 30, 77, 49, 44, 35, 40, 37, 38, 31, 30, 77,
                   38, 35, 42, 64, 77, 27, 40, 30, 77, 45, 40, 31,
                   31, 44, 77, 41, 32, 77, 29, 41, 38, 30, 77, 29,
                   41, 39, 39, 27, 40, 30, 64, 79, 77, 77, 77, 77,
                   77, 77, 77, 77, 20, 31, 38, 38, 77, 46, 34, 27,
                   46, 77, 35, 46, 45, 77, 45, 29, 47, 38, 42, 46,
                   41, 44, 77, 49, 31, 38, 38, 77, 46, 34, 41, 45,
                   31, 77, 42, 27, 45, 45, 35, 41, 40, 45, 77, 44,
                   31, 27, 30, 79, 77, 77, 77, 77, 77, 77, 77, 77,
                   23, 34, 35, 29, 34, 77, 51, 31, 46, 77, 45, 47,
                   44, 48, 35, 48, 31, 64, 77, 45, 46, 27, 39, 42,
                   31, 30, 77, 41, 40, 77, 46, 34, 31, 45, 31, 77,
                   38, 35, 32, 31, 38, 31, 45, 45, 77, 46, 34, 35,
                   40, 33, 45, 64, 79, 77, 77, 77, 77, 77, 77, 77,
                   77, 20, 34, 31, 77, 34, 27, 40, 30, 77, 46, 34,
                   27, 46, 77, 39, 41, 29, 37, 31, 30, 77, 46, 34,
                   31, 39, 64, 77, 27, 40, 30, 77, 46, 34, 31, 77,
                   34, 31, 27, 44, 46, 77, 46, 34, 27, 46, 77, 32,
                   31, 30, 66, 79, 77, 77, 77, 77, 77, 77, 77, 77,
                   1, 40, 30, 77, 41, 40, 77, 46, 34, 31, 77, 42,
                   31, 30, 31, 45, 46, 27, 38, 64, 77, 46, 34, 31,
                   45, 31, 77, 49, 41, 44, 30, 45, 77, 27, 42, 42,
                   31, 27, 44, 65, 79, 77, 77, 77, 77, 77, 77, 77,
                   77, 13, 51, 77, 40, 27, 39, 31, 77, 35, 45, 77,
                   15, 52, 51, 39, 27, 40, 30, 35, 27, 45, 64, 77,
                   11, 35, 40, 33, 77, 41, 32, 77, 11, 35, 40, 33,
                   45, 66, 79, 77, 77, 77, 77, 77, 77, 77, 77, 12,
                   41, 41, 37, 77, 41, 40, 77, 39, 51, 77, 23, 41,
                   44, 37, 45, 64, 77, 51, 31, 77, 13, 35, 33, 34,
                   46, 51, 64, 77, 27, 40, 30, 77, 30, 31, 45, 42,
                   27, 35, 44, 67, 79, 77, 77, 77, 77, 77, 77, 77,
                   77, 14, 41, 46, 34, 35, 40, 33, 77, 28, 31, 45,
                   35, 30, 31, 77, 44, 31, 39, 27, 35, 40, 45, 63,
                   77, 18, 41, 47, 40, 30, 77, 46, 34, 31, 77, 30,
                   31, 29, 27, 51, 79, 77, 77, 77, 77, 77, 77, 77,
                   77, 15, 32, 77, 46, 34, 27, 46, 77, 29, 41, 38,
                   41, 45, 45, 27, 38, 77, 23, 44, 31, 29, 37, 64,
                   77, 28, 41, 47, 40, 30, 38, 31, 45, 45, 77, 27,
                   40, 30, 77, 28, 27, 44, 31, 79, 77, 77, 77, 77,
                   77, 77, 77, 77, 20, 34, 31, 77, 38, 41, 40, 31,
                   77, 27, 40, 30, 77, 38, 31, 48, 31, 38, 77, 45,
                   27, 40, 30, 45, 77, 45, 46, 44, 31, 46, 29, 34,
                   77, 32, 27, 44, 77, 27, 49, 27, 51, 79, 77, 77,
                   77, 77, 77, 77, 77, 77]]),
               torch.tensor([[0, 0, 0, 1_069, 11, -1, -1, -1, -1]]),
               torch.tensor([[0, 0, 0, 1_069, 11, -1, -1, -1, -1]]),
           ]
           # fmt: on
           self.assertTrue(torch.allclose(tokens[0]   ,					EXPECTED_OUTPUT[0]))
           self.assertTrue(torch.allclose(tokens[1]   ,					EXPECTED_OUTPUT[1]))
           self.assertTrue(torch.allclose(tokens[2]   ,					EXPECTED_OUTPUT[2]))


