import copy
from typing import Any, Dict, List, Optional, Union

import numpy as np
import torch

from ...audio_utils import mel_filter_bank, spectrogram, window_function
from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
from ...feature_extraction_utils import BatchFeature
from ...utils import TensorType, logging


UpperCAmelCase_           =				logging.get_logger(__name__)




class 			__magic_name__	(		__SCREAMING_SNAKE_CASE     ):





   """simple docstring"""




   lowerCAmelCase   :     List[Any]	      = ["""input_features""", """is_longer"""]



   def __init__(						self       :	str		,	_lowercase       :	Optional[Any]=64		,	_lowercase       :	Union[str, Any]=48_000		,	_lowercase       :	List[str]=480		,	_lowercase       :	Optional[int]=10		,	_lowercase       :	List[str]=1_024		,	_lowercase       :	Any=0.0		,	_lowercase       :	str=False		,	_lowercase       :	Tuple = 0		,	_lowercase       :	List[Any] = 14_000		,	_lowercase       :	Optional[int] = None		,	_lowercase       :	int = "fusion"		,	_lowercase       :	List[Any] = "repeatpad"		,	**_lowercase       :	Any		,	):



    """simple docstring"""



    super().__init__(
        feature_size=A_		,	sampling_rate=A_		,	padding_value=A_		,	return_attention_mask=A_		,	**A_		,	)
    _UpperCamelCase:  Any    						=			top_db
    _UpperCamelCase:  Optional[Any]    						=			truncation
    _UpperCamelCase:  Any    						=			padding
    _UpperCamelCase:  Dict    						=			fft_window_size
    _UpperCamelCase:  Optional[int]    						=			(fft_window_size >> 1) + 1
    _UpperCamelCase:  List[str]    						=			hop_length
    _UpperCamelCase:  Optional[int]    						=			max_length_s
    _UpperCamelCase:  Union[str, Any]    						=			max_length_s * sampling_rate
    _UpperCamelCase:  Any    						=			sampling_rate
    _UpperCamelCase:  List[str]    						=			frequency_min
    _UpperCamelCase:  int    						=			frequency_max
    _UpperCamelCase:  str    						=			mel_filter_bank(
        num_frequency_bins=self.nb_frequency_bins		,	num_mel_filters=A_		,	min_frequency=A_		,	max_frequency=A_		,	sampling_rate=A_		,	norm=A_		,	mel_scale='''htk'''		,	)
    _UpperCamelCase:  Optional[int]    						=			mel_filter_bank(
        num_frequency_bins=self.nb_frequency_bins		,	num_mel_filters=A_		,	min_frequency=A_		,	max_frequency=A_		,	sampling_rate=A_		,	norm='''slaney'''		,	mel_scale='''slaney'''		,	)



   def 	lowerCAmelCase    (						self       :	str				):



    """simple docstring"""



    _UpperCamelCase:  str    						=			copy.deepcopy(self.__dict__				)
    _UpperCamelCase:  Any    						=			self.__class__.__name__
    if "mel_filters" in output:
     del output["mel_filters"]
    if "mel_filters_slaney" in output:
     del output["mel_filters_slaney"]
    return output



   def 	lowerCAmelCase    (						self       :	Dict		,	_lowercase       :	Dict		,	_lowercase       :	Tuple = None				):



    """simple docstring"""



    _UpperCamelCase:  List[str]    						=			spectrogram(
        A_		,	window_function(self.fft_window_size		,	'''hann'''				)		,	frame_length=self.fft_window_size		,	hop_length=self.hop_length		,	power=2.0		,	mel_filters=A_		,	log_mel='''dB'''		,	)
    return log_mel_spectrogram.T



   def 	lowerCAmelCase    (						self       :	int		,	_lowercase       :	List[Any]		,	_lowercase       :	Any		,	_lowercase       :	int				):



    """simple docstring"""



    _UpperCamelCase:  List[str]    						=			np.array_split(list(range(0		,	total_frames - chunk_frames + 1				)				)		,	3				)
    if len(ranges[1]				) == 0:
     # if the audio is too short, we just use the first chunk
     _UpperCamelCase:  List[Any]    						=			[0]
    if len(ranges[2]				) == 0:
     # if the audio is too short, we just use the first chunk
     _UpperCamelCase:  Optional[Any]    						=			[0]
    # randomly choose index for each part
    _UpperCamelCase:  Dict    						=			np.random.choice(ranges[0]				)
    _UpperCamelCase:  List[Any]    						=			np.random.choice(ranges[1]				)
    _UpperCamelCase:  Optional[Any]    						=			np.random.choice(ranges[2]				)

    _UpperCamelCase:  List[str]    						=			mel[idx_front : idx_front + chunk_frames, :]
    _UpperCamelCase:  Tuple    						=			mel[idx_middle : idx_middle + chunk_frames, :]
    _UpperCamelCase:  Optional[int]    						=			mel[idx_back : idx_back + chunk_frames, :]

    _UpperCamelCase:  List[str]    						=			torch.tensor(mel[None, None, :]				)
    _UpperCamelCase:  Optional[Any]    						=			torch.nn.functional.interpolate(
        A_		,	size=[chunk_frames, 64]		,	mode='''bilinear'''		,	align_corners=A_				)
    _UpperCamelCase:  Dict    						=			mel_shrink[0][0].numpy()
    _UpperCamelCase:  List[Any]    						=			np.stack([mel_shrink, mel_chunk_front, mel_chunk_middle, mel_chunk_back]		,	axis=0				)
    return mel_fusion



   def 	lowerCAmelCase    (						self       :	Optional[Any]		,	_lowercase       :	List[str]		,	_lowercase       :	Union[str, Any]		,	_lowercase       :	List[Any]		,	_lowercase       :	Optional[Any]				):



    """simple docstring"""



    if waveform.shape[0] > max_length:
     if truncation == "rand_trunc":
      _UpperCamelCase:  str    						=			True
      # random crop to max_length (for compatibility) -> this should be handled by self.pad
      _UpperCamelCase:  Any    						=			len(A_				) - max_length
      _UpperCamelCase:  Any    						=			np.random.randint(0		,	overflow + 1				)
      _UpperCamelCase:  Optional[Any]    						=			waveform[idx : idx + max_length]
      _UpperCamelCase:  Tuple    						=			self._np_extract_fbank_features(A_		,	self.mel_filters_slaney				)[None, :]
     elif truncation == "fusion":
      _UpperCamelCase:  Union[str, Any]    						=			self._np_extract_fbank_features(A_		,	self.mel_filters				)
      _UpperCamelCase:  List[str]    						=			max_length // self.hop_length + 1  # the +1 related to how the spectrogram is computed
      _UpperCamelCase:  Optional[Any]    						=			mel.shape[0]
      if chunk_frames == total_frames:
       # there is a corner case where the audio length is larger than max_length but smaller than max_length+hop_length.
       # In this case, we just use the whole audio.
       _UpperCamelCase:  Union[str, Any]    						=			np.stack([mel, mel, mel, mel]		,	axis=0				)
       _UpperCamelCase:  int    						=			False
      else:
       _UpperCamelCase:  Dict    						=			self._random_mel_fusion(A_		,	A_		,	A_				)
       _UpperCamelCase:  Optional[int]    						=			True
     else:
      raise NotImplementedError(f"""data_truncating {truncation} not implemented"""				)

    else:
     _UpperCamelCase:  Tuple    						=			False
     # only use repeat as a new possible value for padding. you repeat the audio before applying the usual max_length padding
     if waveform.shape[0] < max_length:
      if padding == "repeat":
       _UpperCamelCase:  Optional[Any]    						=			int(max_length / len(A_				)				)
       _UpperCamelCase:  str    						=			np.stack(np.tile(A_		,	n_repeat + 1				)				)[:max_length]
      if padding == "repeatpad":
       _UpperCamelCase:  int    						=			int(max_length / len(A_				)				)
       _UpperCamelCase:  List[str]    						=			np.stack(np.tile(A_		,	A_				)				)
      _UpperCamelCase:  Union[str, Any]    						=			np.pad(A_		,	(0, max_length - waveform.shape[0])		,	mode='''constant'''		,	constant_values=0				)

     if truncation == "fusion":
      _UpperCamelCase:  Union[str, Any]    						=			self._np_extract_fbank_features(A_		,	self.mel_filters				)
      _UpperCamelCase:  Any    						=			np.stack([input_mel, input_mel, input_mel, input_mel]		,	axis=0				)
     else:
      _UpperCamelCase:  List[str]    						=			self._np_extract_fbank_features(A_		,	self.mel_filters_slaney				)[None, :]

    return input_mel, longer



   def __call__(						self       :	Union[str, Any]		,	_lowercase       :	List[str]		,	_lowercase       :	Dict = None		,	_lowercase       :	List[str] = None		,	_lowercase       :	Dict = None		,	_lowercase       :	Union[str, Any] = None		,	_lowercase       :	Any = None		,	**_lowercase       :	str		,	):



    """simple docstring"""



    _UpperCamelCase:  Any    						=			truncation if truncation is not None else self.truncation
    _UpperCamelCase:  Optional[int]    						=			padding if padding else self.padding

    if sampling_rate is not None:
     if sampling_rate != self.sampling_rate:
      raise ValueError(
          f"""The model corresponding to this feature extractor: {self.__class__.__name__} was trained using a"""
          f""" sampling rate of {self.sampling_rate}. Please make sure that the provided `raw_speech` input"""
          f""" was sampled with {self.sampling_rate} and not {sampling_rate}."""				)
    else:
     logger.warning(
         '''It is strongly recommended to pass the `sampling_rate` argument to this function. '''
         '''Failing to do so can result in silent errors that might be hard to debug.'''				)

    _UpperCamelCase:  Dict    						=			isinstance(A_		,	np.ndarray				) and len(raw_speech.shape				) > 1
    if is_batched_numpy and len(raw_speech.shape				) > 2:
     raise ValueError(f"""Only mono-channel audio is supported for input to {self}"""				)
    _UpperCamelCase:  List[Any]    						=			is_batched_numpy or (
        isinstance(A_		,	(list, tuple)				) and (isinstance(raw_speech[0]		,	(np.ndarray, tuple, list)				))
    )

    if is_batched:
     _UpperCamelCase:  int    						=			[np.asarray(A_		,	dtype=np.floataa				) for speech in raw_speech]
    elif not is_batched and not isinstance(A_		,	np.ndarray				):
     _UpperCamelCase:  str    						=			np.asarray(A_		,	dtype=np.floataa				)
    elif isinstance(A_		,	np.ndarray				) and raw_speech.dtype is np.dtype(np.floataa				):
     _UpperCamelCase:  Union[str, Any]    						=			raw_speech.astype(np.floataa				)

    # always return batch
    if not is_batched:
     _UpperCamelCase:  Union[str, Any]    						=			[np.asarray(A_				)]

    # convert to mel spectrogram, truncate and pad if needed.
    _UpperCamelCase:  Any    						=			[
        self._get_input_mel(A_		,	max_length if max_length else self.nb_max_samples		,	A_		,	A_				)
        for waveform in raw_speech
    ]

    _UpperCamelCase:  Union[str, Any]    						=			[]
    _UpperCamelCase:  List[str]    						=			[]
    for mel, longer in padded_inputs:
     input_mel.append(A_				)
     is_longer.append(A_				)

    if truncation == "fusion" and sum(A_				) == 0:
     # if no audio is longer than 10s, then randomly select one audio to be longer
     _UpperCamelCase:  Tuple    						=			np.random.randint(0		,	len(A_				)				)
     _UpperCamelCase:  Any    						=			True

    if isinstance(input_mel[0]		,	A_				):
     _UpperCamelCase:  str    						=			[np.asarray(A_		,	dtype=np.floataa				) for feature in input_mel]

    # is_longer is a list of bool
    _UpperCamelCase:  Optional[int]    						=			[[longer] for longer in is_longer]

    _UpperCamelCase:  Optional[Any]    						=			{'''input_features''': input_mel, '''is_longer''': is_longer}
    _UpperCamelCase:  Tuple    						=			BatchFeature(A_				)

    if return_tensors is not None:
     _UpperCamelCase:  List[str]    						=			input_features.convert_to_tensors(A_				)

    return input_features






from __future__ import annotations

import random
import unittest

from transformers import TransfoXLConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
  import tensorflow as tf

  from transformers import (
      TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFTransfoXLForSequenceClassification,
      TFTransfoXLLMHeadModel,
      TFTransfoXLModel,
  )



class 					__snake_case	:


    '''simple docstring'''







    def __init__(       self   ,				A_   ,				):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			parent
        SCREAMING_SNAKE_CASE__											=			13
        SCREAMING_SNAKE_CASE__											=			7
        SCREAMING_SNAKE_CASE__											=			30
        SCREAMING_SNAKE_CASE__											=			self.seq_length + self.mem_len
        SCREAMING_SNAKE_CASE__											=			15
        SCREAMING_SNAKE_CASE__											=			True
        SCREAMING_SNAKE_CASE__											=			True
        SCREAMING_SNAKE_CASE__											=			99
        SCREAMING_SNAKE_CASE__											=			[10, 50, 80]
        SCREAMING_SNAKE_CASE__											=			32
        SCREAMING_SNAKE_CASE__											=			32
        SCREAMING_SNAKE_CASE__											=			4
        SCREAMING_SNAKE_CASE__											=			8
        SCREAMING_SNAKE_CASE__											=			1_28
        SCREAMING_SNAKE_CASE__											=			2
        SCREAMING_SNAKE_CASE__											=			2
        SCREAMING_SNAKE_CASE__											=			None
        SCREAMING_SNAKE_CASE__											=			1
        SCREAMING_SNAKE_CASE__											=			0
        SCREAMING_SNAKE_CASE__											=			3
        SCREAMING_SNAKE_CASE__											=			self.vocab_size - 1
        SCREAMING_SNAKE_CASE__											=			0.01



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			ids_tensor([self.batch_size, self.seq_length]   ,				self.vocab_size     )
        SCREAMING_SNAKE_CASE__											=			ids_tensor([self.batch_size, self.seq_length]   ,				self.vocab_size     )

        SCREAMING_SNAKE_CASE__											=			None
        if self.use_labels:
            SCREAMING_SNAKE_CASE__											=			ids_tensor([self.batch_size, self.seq_length]   ,				self.vocab_size     )

        SCREAMING_SNAKE_CASE__											=			TransfoXLConfig(
            vocab_size=self.vocab_size   ,				mem_len=self.mem_len   ,				clamp_len=self.clamp_len   ,				cutoffs=self.cutoffs   ,				d_model=self.hidden_size   ,				d_embed=self.d_embed   ,				n_head=self.num_attention_heads   ,				d_head=self.d_head   ,				d_inner=self.d_inner   ,				div_val=self.div_val   ,				n_layer=self.num_hidden_layers   ,				eos_token_id=self.eos_token_id   ,				pad_token_id=self.vocab_size - 1   ,				init_range=self.init_range   ,				num_labels=self.num_labels   ,				)

        return (config, input_ids_a, input_ids_a, lm_labels)



    def  lowercase_					(       self     ):





        '''simple docstring'''

        random.seed(self.seed     )
        tf.random.set_seed(self.seed     )



    def  lowercase_					(       self   ,				A_   ,				A_   ,				A_   ,				A_     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			TFTransfoXLModel(A_     )

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model(A_     ).to_tuple()

        SCREAMING_SNAKE_CASE__											=			{'''input_ids''': input_ids_a, '''mems''': mems_a}

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model(A_     ).to_tuple()

        self.parent.assertEqual(hidden_states_a.shape   ,				(self.batch_size, self.seq_length, self.hidden_size)     )
        self.parent.assertEqual(hidden_states_a.shape   ,				(self.batch_size, self.seq_length, self.hidden_size)     )
        self.parent.assertListEqual(
            [mem.shape for mem in mems_a]   ,				[(self.mem_len, self.batch_size, self.hidden_size)] * self.num_hidden_layers   ,				)
        self.parent.assertListEqual(
            [mem.shape for mem in mems_a]   ,				[(self.mem_len, self.batch_size, self.hidden_size)] * self.num_hidden_layers   ,				)



    def  lowercase_					(       self   ,				A_   ,				A_   ,				A_   ,				A_     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			TFTransfoXLLMHeadModel(A_     )

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model(A_     ).to_tuple()

        SCREAMING_SNAKE_CASE__											=			{'''input_ids''': input_ids_a, '''labels''': lm_labels}
        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model(A_     ).to_tuple()

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model([input_ids_a, mems_a]     ).to_tuple()

        SCREAMING_SNAKE_CASE__											=			{'''input_ids''': input_ids_a, '''mems''': mems_a, '''labels''': lm_labels}

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			model(A_     ).to_tuple()

        self.parent.assertEqual(lm_logits_a.shape   ,				(self.batch_size, self.seq_length, self.vocab_size)     )
        self.parent.assertListEqual(
            [mem.shape for mem in mems_a]   ,				[(self.mem_len, self.batch_size, self.hidden_size)] * self.num_hidden_layers   ,				)

        self.parent.assertEqual(lm_logits_a.shape   ,				(self.batch_size, self.seq_length, self.vocab_size)     )
        self.parent.assertListEqual(
            [mem.shape for mem in mems_a]   ,				[(self.mem_len, self.batch_size, self.hidden_size)] * self.num_hidden_layers   ,				)



    def  lowercase_					(       self   ,				A_   ,				A_   ,				A_   ,				A_     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			TFTransfoXLForSequenceClassification(A_     )
        SCREAMING_SNAKE_CASE__											=			model(A_     )
        self.parent.assertEqual(result.logits.shape   ,				(self.batch_size, self.num_labels)     )




    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.prepare_config_and_inputs()
        ((SCREAMING_SNAKE_CASE__)				,		(SCREAMING_SNAKE_CASE__)				,		(SCREAMING_SNAKE_CASE__)				,		(SCREAMING_SNAKE_CASE__))											=			config_and_inputs
        SCREAMING_SNAKE_CASE__											=			{'''input_ids''': input_ids_a}
        return config, inputs_dict





@require_tf
class 					__snake_case	(  __SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE			,     unittest.TestCase    ):


    '''simple docstring'''







    lowerCamelCase__    :		Optional[int]				=	(
        (TFTransfoXLModel, TFTransfoXLLMHeadModel, TFTransfoXLForSequenceClassification) if is_tf_available() else ()
    )
    lowerCamelCase__    :		List[str]				=	() if is_tf_available() else ()
    lowerCamelCase__    :		List[Any]				=	(
        {
            """feature-extraction""": TFTransfoXLModel,
            """text-classification""": TFTransfoXLForSequenceClassification,
            """text-generation""": TFTransfoXLLMHeadModel,
            """zero-shot""": TFTransfoXLForSequenceClassification,
        }
        if is_tf_available()
        else {}
    )
    # TODO: add this test when TFTransfoXLLMHead has a linear output layer implemented
    lowerCamelCase__    :		Tuple				=	False
    lowerCamelCase__    :		Any				=	False
    lowerCamelCase__    :		Dict				=	False
    lowerCamelCase__    :		Optional[Any]				=	False



    def  lowercase_					(       self   ,				A_   ,				A_   ,				A_   ,				A_   ,				A_     ):





        '''simple docstring'''

        if pipeline_test_casse_name == "TextGenerationPipelineTests":
            # Get `ValueError: AttributeError: 'NoneType' object has no attribute 'new_ones'` or `AssertionError`.
            # `TransfoXLConfig` was never used in pipeline tests: cannot create a simple
            # tokenizer.
            return True

        return False



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			TFTransfoXLModelTester(self     )
        SCREAMING_SNAKE_CASE__											=			ConfigTester(self   ,				config_class=A_   ,				d_embed=37     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.config_tester.run_common_tests()



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.model_tester.set_seed()
        SCREAMING_SNAKE_CASE__											=			self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_transfo_xl_model(*A_     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.model_tester.set_seed()
        SCREAMING_SNAKE_CASE__											=			self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_transfo_xl_lm_head(*A_     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_transfo_xl_for_sequence_classification(*A_     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			self.model_tester.prepare_config_and_inputs_for_common()
        SCREAMING_SNAKE_CASE__											=			[TFTransfoXLForSequenceClassification]

        for model_class in self.all_model_classes:
            SCREAMING_SNAKE_CASE__											=			model_class(A_     )
            assert isinstance(model.get_input_embeddings()   ,				tf.keras.layers.Layer     )
            if model_class in list_other_models_with_output_ebd:
                SCREAMING_SNAKE_CASE__											=			model.get_output_embeddings()
                assert isinstance(A_   ,				tf.keras.layers.Layer     )
                SCREAMING_SNAKE_CASE__											=			model.get_bias()
                assert name is None
            else:
                SCREAMING_SNAKE_CASE__											=			model.get_output_embeddings()
                assert x is None
                SCREAMING_SNAKE_CASE__											=			model.get_bias()
                assert name is None



    def  lowercase_					(       self     ):





        '''simple docstring'''

        pass



    @slow
    def  lowercase_					(       self     ):





        '''simple docstring'''

        for model_name in TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
            SCREAMING_SNAKE_CASE__											=			TFTransfoXLModel.from_pretrained(A_     )
            self.assertIsNotNone(A_     )




    @unittest.skip(reason='''This model doesn\'t play well with fit() due to not returning a single loss.'''     )
    def  lowercase_					(       self     ):





        '''simple docstring'''

        pass





@require_tf
class 					__snake_case	(  unittest.TestCase    ):


    '''simple docstring'''







    @unittest.skip('''Skip test until #12651 is resolved.'''     )
    @slow
    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			TFTransfoXLLMHeadModel.from_pretrained('''transfo-xl-wt103'''     )
        # fmt: off
        SCREAMING_SNAKE_CASE__											=			tf.convert_to_tensor([[33,12_97,2,1,10_09,4,11_09,1_17_39,47_62,3_58,5,25,2_45,22,17_06,17,2_00_98,5,32_15,21,37,11_10,3,13,10_41,4,24,6_03,4_90,2,7_14_77,2_00_98,10_44_47,2,2_09_61,1,26_04,4,1,3_29,3,62_24,8_31,1_60_02,2,8,6_03,7_89_67,2_95_46,23,8_03,20,25,4_16,5,8,2_32,4,2_77,6,18_55,46_01,3,2_95_46,54,8,36_09,5,5_72_11,49,4,1,2_77,18,8,17_55,1_56_91,3,3_41,25,4_16,6_93,4_25_73,71,17,4_01,94,31,1_79_19,2,2_95_46,78_73,18,1,4_35,23,1_10_11,7_55,5,51_67,3,79_83,98,84,2,2_95_46,32_67,8,36_09,4,1,48_65,10_75,2,60_87,71,6,3_46,8,58_54,3,2_95_46,8_24,14_00,18_68,2,19,1_60,2,3_11,8,54_96,2,2_09_20,17,25,1_50_97,3,24,24,0]]   ,				dtype=tf.intaa     )  # noqa: E231
        # fmt: on
        #  In 1991 , the remains of Russian Tsar Nicholas II and his family
        #  ( except for Alexei and Maria ) are discovered .
        #  The voice of Nicholas's young son , Tsarevich Alexei Nikolaevich , narrates the
        #  remainder of the story . 1883 Western Siberia ,
        #  a young Grigori Rasputin is asked by his father and a group of men to perform magic .
        #  Rasputin has a vision and denounces one of the men as a horse thief . Although his
        #  father initially slaps him for making such an accusation , Rasputin watches as the
        #  man is chased outside and beaten . Twenty years later , Rasputin sees a vision of
        #  the Virgin Mary , prompting him to become a priest . Rasputin quickly becomes famous ,
        #  with people , even a bishop , begging for his blessing . <eod> </s> <eos>

        # fmt: off
        SCREAMING_SNAKE_CASE__											=			[33,12_97,2,1,10_09,4,11_09,1_17_39,47_62,3_58,5,25,2_45,22,17_06,17,2_00_98,5,32_15,21,37,11_10,3,13,10_41,4,24,6_03,4_90,2,7_14_77,2_00_98,10_44_47,2,2_09_61,1,26_04,4,1,3_29,3,62_24,8_31,1_60_02,2,8,6_03,7_89_67,2_95_46,23,8_03,20,25,4_16,5,8,2_32,4,2_77,6,18_55,46_01,3,2_95_46,54,8,36_09,5,5_72_11,49,4,1,2_77,18,8,17_55,1_56_91,3,3_41,25,4_16,6_93,4_25_73,71,17,4_01,94,31,1_79_19,2,2_95_46,78_73,18,1,4_35,23,1_10_11,7_55,5,51_67,3,79_83,98,84,2,2_95_46,32_67,8,36_09,4,1,48_65,10_75,2,60_87,71,6,3_46,8,58_54,3,2_95_46,8_24,14_00,18_68,2,19,1_60,2,3_11,8,54_96,2,2_09_20,17,25,1_50_97,3,24,24,0,33,1,18_57,2,1,10_09,4,11_09,1_17_39,47_62,3_58,5,25,2_45,28,11_10,3,13,10_41,4,24,6_03,4_90,2,7_14_77,2_00_98,10_44_47,2,2_09_61,1,26_04,4,1,3_29,3,0]  # noqa: E231
        # fmt: on
        #  In 1991, the remains of Russian Tsar Nicholas II and his family (
        #  except for Alexei and Maria ) are discovered. The voice of young son,
        #  Tsarevich Alexei Nikolaevich, narrates the remainder of the story.
        #  1883 Western Siberia, a young Grigori Rasputin is asked by his father
        #  and a group of men to perform magic. Rasputin has a vision and
        #  denounces one of the men as a horse thief. Although his father initially
        #  slaps him for making such an accusation, Rasputin watches as the man
        #  is chased outside and beaten. Twenty years later, Rasputin sees a vision
        #  of the Virgin Mary, prompting him to become a priest.
        #  Rasputin quickly becomes famous, with people, even a bishop, begging for
        #  his blessing. <unk> <unk> <eos> In the 1990s, the remains of Russian Tsar
        # Nicholas II and his family were discovered. The voice of <unk> young son,
        # Tsarevich Alexei Nikolaevich, narrates the remainder of the story.<eos>

        SCREAMING_SNAKE_CASE__											=			model.generate(A_   ,				max_length=2_00   ,				do_sample=A_     )
        self.assertListEqual(output_ids[0].numpy().tolist()   ,				A_     )
