


from collections import Counter

import sacrebleu
import sacremoses
from packaging import version

import datasets


UpperCAmelCase			=    """\
@inproceedings{xu-etal-2016-optimizing,
title = {Optimizing Statistical Machine Translation for Text Simplification},
authors={Xu, Wei and Napoles, Courtney and Pavlick, Ellie and Chen, Quanze and Callison-Burch, Chris},
journal = {Transactions of the Association for Computational Linguistics},
volume = {4},
year={2016},
url = {https://www.aclweb.org/anthology/Q16-1029},
pages = {401--415},
}
"""

UpperCAmelCase			=    """\
SARI is a metric used for evaluating automatic text simplification systems.
The metric compares the predicted simplified sentences against the reference
and the source sentences. It explicitly measures the goodness of words that are
added, deleted and kept by the system.
Sari = (F1_add + F1_keep + P_del) / 3
where
F1_add: n-gram F1 score for add operation
F1_keep: n-gram F1 score for keep operation
P_del: n-gram precision score for delete operation
n = 4, as in the original paper.

This implementation is adapted from Tensorflow's tensor2tensor implementation [3].
It has two differences with the original GitHub [1] implementation:
  (1) Defines 0/0=1 instead of 0 to give higher scores for predictions that match
      a target exactly.
  (2) Fixes an alleged bug [2] in the keep score computation.
[1] https://github.com/cocoxu/simplification/blob/master/SARI.py
    (commit 0210f15)
[2] https://github.com/cocoxu/simplification/issues/6
[3] https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py
"""


UpperCAmelCase			=    """
Calculates sari score (between 0 and 100) given a list of source and predicted
sentences, and a list of lists of reference sentences.
Args:
    sources: list of source sentences where each sentence should be a string.
    predictions: list of predicted sentences where each sentence should be a string.
    references: list of lists of reference sentences where each sentence should be a string.
Returns:
    sari: sari score
Examples:
    >>> sources=[\"About 95 species are currently accepted .\"]
    >>> predictions=[\"About 95 you now get in .\"]
    >>> references=[[\"About 95 species are currently known .\",\"About 95 species are now accepted .\",\"95 species are now accepted .\"]]
    >>> sari = datasets.load_metric(\"sari\")
    >>> results = sari.compute(sources=sources, predictions=predictions, references=references)
    >>> print(results)
    {'sari': 26.953601953601954}
"""






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)->  str:




      """simple docstring"""

      snake_case_       =      [rgram for rgrams in rgramslist for rgram in rgrams]
      snake_case_       =      Counter(SCREAMING_SNAKE_CASE					)

      snake_case_       =      Counter(SCREAMING_SNAKE_CASE					)
      snake_case_       =      Counter()
      for sgram, scount in sgramcounter.items():
            snake_case_       =      scount * numref

      snake_case_       =      Counter(SCREAMING_SNAKE_CASE					)
      snake_case_       =      Counter()
      for cgram, ccount in cgramcounter.items():
            snake_case_       =      ccount * numref

      # KEEP
      snake_case_       =      sgramcounter_rep & cgramcounter_rep
      snake_case_       =      keepgramcounter_rep & rgramcounter
      snake_case_       =      sgramcounter_rep & rgramcounter

      snake_case_       =      0
      snake_case_       =      0
      for keepgram in keepgramcountergood_rep:
            keeptmpscorea += keepgramcountergood_rep[keepgram] / keepgramcounter_rep[keepgram]
            # Fix an alleged bug [2] in the keep score computation.
            # keeptmpscore2 += keepgramcountergood_rep[keepgram] / keepgramcounterall_rep[keepgram]
            keeptmpscorea += keepgramcountergood_rep[keepgram]
      # Define 0/0=1 instead of 0 to give higher scores for predictions that match
      #      a target exactly.
      snake_case_       =      1
      snake_case_       =      1
      if len(SCREAMING_SNAKE_CASE					) > 0:
            snake_case_       =      keeptmpscorea / len(SCREAMING_SNAKE_CASE					)
      if len(SCREAMING_SNAKE_CASE					) > 0:
            # Fix an alleged bug [2] in the keep score computation.
            # keepscore_recall = keeptmpscore2 / len(keepgramcounterall_rep)
            snake_case_       =      keeptmpscorea / sum(keepgramcounterall_rep.values()					)
      snake_case_       =      0
      if keepscore_precision > 0 or keepscore_recall > 0:
            snake_case_       =      2 * keepscore_precision * keepscore_recall / (keepscore_precision + keepscore_recall)

      # DELETION
      snake_case_       =      sgramcounter_rep - cgramcounter_rep
      snake_case_       =      delgramcounter_rep - rgramcounter
      snake_case_       =      sgramcounter_rep - rgramcounter
      snake_case_       =      0
      snake_case_       =      0
      for delgram in delgramcountergood_rep:
            deltmpscorea += delgramcountergood_rep[delgram] / delgramcounter_rep[delgram]
            deltmpscorea += delgramcountergood_rep[delgram] / delgramcounterall_rep[delgram]
      # Define 0/0=1 instead of 0 to give higher scores for predictions that match
      # a target exactly.
      snake_case_       =      1
      if len(SCREAMING_SNAKE_CASE					) > 0:
            snake_case_       =      deltmpscorea / len(SCREAMING_SNAKE_CASE					)

      # ADDITION
      snake_case_       =      set(SCREAMING_SNAKE_CASE					) - set(SCREAMING_SNAKE_CASE					)
      snake_case_       =      set(SCREAMING_SNAKE_CASE					) & set(SCREAMING_SNAKE_CASE					)
      snake_case_       =      set(SCREAMING_SNAKE_CASE					) - set(SCREAMING_SNAKE_CASE					)

      snake_case_       =      0
      for addgram in addgramcountergood:
            addtmpscore += 1

      # Define 0/0=1 instead of 0 to give higher scores for predictions that match
      # a target exactly.
      snake_case_       =      1
      snake_case_       =      1
      if len(SCREAMING_SNAKE_CASE					) > 0:
            snake_case_       =      addtmpscore / len(SCREAMING_SNAKE_CASE					)
      if len(SCREAMING_SNAKE_CASE					) > 0:
            snake_case_       =      addtmpscore / len(SCREAMING_SNAKE_CASE					)
      snake_case_       =      0
      if addscore_precision > 0 or addscore_recall > 0:
            snake_case_       =      2 * addscore_precision * addscore_recall / (addscore_precision + addscore_recall)

      return (keepscore, delscore_precision, addscore)






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)->  Optional[Any]:




      """simple docstring"""

      snake_case_       =      len(SCREAMING_SNAKE_CASE					)

      snake_case_       =      ssent.split(''' '''					)
      snake_case_       =      csent.split(''' '''					)
      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []

      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []
      snake_case_       =      []
      for rsent in rsents:
            snake_case_       =      rsent.split(''' '''					)
            snake_case_       =      []
            snake_case_       =      []
            snake_case_       =      []
            ragramslist.append(SCREAMING_SNAKE_CASE					)
            for i in range(0					,					len(SCREAMING_SNAKE_CASE					) - 1					):
                  if i < len(SCREAMING_SNAKE_CASE					) - 1:
                        snake_case_       =      ragrams[i] + " " + ragrams[i + 1]
                        ragrams.append(SCREAMING_SNAKE_CASE					)
                  if i < len(SCREAMING_SNAKE_CASE					) - 2:
                        snake_case_       =      ragrams[i] + " " + ragrams[i + 1] + " " + ragrams[i + 2]
                        ragrams.append(SCREAMING_SNAKE_CASE					)
                  if i < len(SCREAMING_SNAKE_CASE					) - 3:
                        snake_case_       =      ragrams[i] + " " + ragrams[i + 1] + " " + ragrams[i + 2] + " " + ragrams[i + 3]
                        ragrams.append(SCREAMING_SNAKE_CASE					)
            ragramslist.append(SCREAMING_SNAKE_CASE					)
            ragramslist.append(SCREAMING_SNAKE_CASE					)
            ragramslist.append(SCREAMING_SNAKE_CASE					)

      for i in range(0					,					len(SCREAMING_SNAKE_CASE					) - 1					):
            if i < len(SCREAMING_SNAKE_CASE					) - 1:
                  snake_case_       =      sagrams[i] + " " + sagrams[i + 1]
                  sagrams.append(SCREAMING_SNAKE_CASE					)
            if i < len(SCREAMING_SNAKE_CASE					) - 2:
                  snake_case_       =      sagrams[i] + " " + sagrams[i + 1] + " " + sagrams[i + 2]
                  sagrams.append(SCREAMING_SNAKE_CASE					)
            if i < len(SCREAMING_SNAKE_CASE					) - 3:
                  snake_case_       =      sagrams[i] + " " + sagrams[i + 1] + " " + sagrams[i + 2] + " " + sagrams[i + 3]
                  sagrams.append(SCREAMING_SNAKE_CASE					)

      for i in range(0					,					len(SCREAMING_SNAKE_CASE					) - 1					):
            if i < len(SCREAMING_SNAKE_CASE					) - 1:
                  snake_case_       =      cagrams[i] + " " + cagrams[i + 1]
                  cagrams.append(SCREAMING_SNAKE_CASE					)
            if i < len(SCREAMING_SNAKE_CASE					) - 2:
                  snake_case_       =      cagrams[i] + " " + cagrams[i + 1] + " " + cagrams[i + 2]
                  cagrams.append(SCREAMING_SNAKE_CASE					)
            if i < len(SCREAMING_SNAKE_CASE					) - 3:
                  snake_case_       =      cagrams[i] + " " + cagrams[i + 1] + " " + cagrams[i + 2] + " " + cagrams[i + 3]
                  cagrams.append(SCREAMING_SNAKE_CASE					)

      (snake_case_)       =      SARIngram(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)
      (snake_case_)       =      SARIngram(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)
      (snake_case_)       =      SARIngram(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)
      (snake_case_)       =      SARIngram(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)
      snake_case_       =      sum([keepascore, keepascore, keepascore, keepascore]					) / 4
      snake_case_       =      sum([delascore, delascore, delascore, delascore]					) / 4
      snake_case_       =      sum([addascore, addascore, addascore, addascore]					) / 4
      snake_case_       =      (avgkeepscore + avgdelscore + avgaddscore) / 3
      return finalscore






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE = True					,					SCREAMING_SNAKE_CASE = "13a"					,					SCREAMING_SNAKE_CASE = True					)->  Any:




      """simple docstring"""

      if lowercase:
            snake_case_       =      sentence.lower()

      if tokenizer in ["13a", "intl"]:
            if version.parse(sacrebleu.__version__					).major >= 2:
                  snake_case_       =      sacrebleu.metrics.bleu._get_tokenizer(SCREAMING_SNAKE_CASE					)()(SCREAMING_SNAKE_CASE					)
            else:
                  snake_case_       =      sacrebleu.TOKENIZERS[tokenizer]()(SCREAMING_SNAKE_CASE					)
      elif tokenizer == "moses":
            snake_case_       =      sacremoses.MosesTokenizer().tokenize(SCREAMING_SNAKE_CASE					,					return_str=SCREAMING_SNAKE_CASE					,					escape=SCREAMING_SNAKE_CASE					)
      elif tokenizer == "penn":
            snake_case_       =      sacremoses.MosesTokenizer().penn_tokenize(SCREAMING_SNAKE_CASE					,					return_str=SCREAMING_SNAKE_CASE					)
      else:
            snake_case_       =      sentence

      if not return_str:
            snake_case_       =      normalized_sent.split()

      return normalized_sent







@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION					,						_KWARGS_DESCRIPTION       )
class lowerCAmelCase_						( datasets.Metric       ):

 '''simple docstring'''

 def 						UpperCamelCase__     (	self					):
       return datasets.MetricInfo(
           description=_DESCRIPTION		,      citation=_CITATION		,      inputs_description=_KWARGS_DESCRIPTION		,      features=datasets.Features(
               {
                   '''sources''': datasets.Value('''string'''		,      id='''sequence'''					),
                   '''predictions''': datasets.Value('''string'''		,      id='''sequence'''					),
                   '''references''': datasets.Sequence(datasets.Value('''string'''		,      id='''sequence'''					)		,      id='''references'''					),
               }					)		,      codebase_urls=[
               '''https://github.com/cocoxu/simplification/blob/master/SARI.py''',
               '''https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py''',
           ]		,      reference_urls=['''https://www.aclweb.org/anthology/Q16-1029.pdf''']		,      )





 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase		,      _UpperCAmelCase		,      _UpperCAmelCase					):
       if not (len(UpperCAmelCase_					) == len(UpperCAmelCase_					) == len(UpperCAmelCase_					)):
             raise ValueError('''Sources length must match predictions and references lengths.'''					)
       snake_case_       =      0
       for src, pred, refs in zip(UpperCAmelCase_		,      UpperCAmelCase_		,      UpperCAmelCase_					):
             sari_score += SARIsent(normalize(UpperCAmelCase_					)		,      normalize(UpperCAmelCase_					)		,      [normalize(UpperCAmelCase_					) for sent in refs]					)
       snake_case_       =      sari_score / len(UpperCAmelCase_					)
       return {"sari": 1_00 * sari_score}







import unittest

from transformers import SpeechaTextaConfig
from transformers.testing_utils import is_torch_available, require_torch, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
   import torch

   from transformers.models.speech_to_text_a.modeling_speech_to_text_a import (
       SpeechaTextaDecoder,
       SpeechaTextaForCausalLM,
   )


@require_torch
class        SCREAMING_SNAKE_CASE	:
     '''simple docstring'''


     def __init__( self				:		List[str]    ,       UpperCAmelCase_				:		Any    ,       UpperCAmelCase_				:		List[Any]=99    ,       UpperCAmelCase_				:		Tuple=13    ,       UpperCAmelCase_				:		Dict=16    ,       UpperCAmelCase_				:		int=7    ,       UpperCAmelCase_				:		Optional[Any]=True    ,       UpperCAmelCase_				:		List[Any]=True    ,       UpperCAmelCase_				:		Any=True    ,       UpperCAmelCase_				:		List[str]=False    ,       UpperCAmelCase_				:		Tuple=True    ,       UpperCAmelCase_				:		Tuple=2    ,       UpperCAmelCase_				:		List[str]=32    ,       UpperCAmelCase_				:		Union[str, Any]=4    ,       UpperCAmelCase_				:		Any=4    ,       UpperCAmelCase_				:		Optional[int]=30    ,       UpperCAmelCase_				:		Union[str, Any]=0    ,       UpperCAmelCase_				:		Union[str, Any]=1    ,       UpperCAmelCase_				:		Any=2    ,       UpperCAmelCase_				:		Dict=None    ,       ):
       SCREAMING_SNAKE_CASE				:					Any		  =			parent
       SCREAMING_SNAKE_CASE				:					Tuple		  =			batch_size
       SCREAMING_SNAKE_CASE				:					str		  =			decoder_seq_length
       # For common tests
       SCREAMING_SNAKE_CASE				:					Tuple		  =			self.decoder_seq_length
       SCREAMING_SNAKE_CASE				:					str		  =			is_training
       SCREAMING_SNAKE_CASE				:					Dict		  =			use_attention_mask
       SCREAMING_SNAKE_CASE				:					int		  =			use_labels

       SCREAMING_SNAKE_CASE				:					Tuple		  =			vocab_size
       SCREAMING_SNAKE_CASE				:					int		  =			d_model
       SCREAMING_SNAKE_CASE				:					List[str]		  =			d_model
       SCREAMING_SNAKE_CASE				:					int		  =			decoder_layers
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			decoder_layers
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			decoder_ffn_dim
       SCREAMING_SNAKE_CASE				:					Tuple		  =			decoder_attention_heads
       SCREAMING_SNAKE_CASE				:					Dict		  =			decoder_attention_heads
       SCREAMING_SNAKE_CASE				:					Optional[int]		  =			eos_token_id
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			bos_token_id
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			pad_token_id
       SCREAMING_SNAKE_CASE				:					List[str]		  =			decoder_start_token_id
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			use_cache
       SCREAMING_SNAKE_CASE				:					Tuple		  =			max_position_embeddings

       SCREAMING_SNAKE_CASE				:					Any		  =			None
       SCREAMING_SNAKE_CASE				:					Tuple		  =			decoder_seq_length
       SCREAMING_SNAKE_CASE				:					int		  =			2
       SCREAMING_SNAKE_CASE				:					Optional[Any]		  =			1


     def  _A				( self				:		Optional[int]					):
       SCREAMING_SNAKE_CASE				:					Optional[Any]		  =			ids_tensor([self.batch_size, self.decoder_seq_length]    ,       self.vocab_size					)

       SCREAMING_SNAKE_CASE				:					str		  =			None
       if self.use_attention_mask:
         SCREAMING_SNAKE_CASE				:					Tuple		  =			ids_tensor([self.batch_size, self.decoder_seq_length]    ,       vocab_size=2					)

       SCREAMING_SNAKE_CASE				:					str		  =			None
       if self.use_labels:
         SCREAMING_SNAKE_CASE				:					List[str]		  =			ids_tensor([self.batch_size, self.decoder_seq_length]    ,       self.vocab_size					)

       SCREAMING_SNAKE_CASE				:					str		  =			SpeechaTextaConfig(
           vocab_size=self.vocab_size    ,       d_model=self.d_model    ,       decoder_layers=self.decoder_layers    ,       decoder_ffn_dim=self.decoder_ffn_dim    ,       decoder_attention_heads=self.decoder_attention_heads    ,       eos_token_id=self.eos_token_id    ,       bos_token_id=self.bos_token_id    ,       use_cache=self.use_cache    ,       pad_token_id=self.pad_token_id    ,       decoder_start_token_id=self.decoder_start_token_id    ,       max_position_embeddings=self.max_position_embeddings    ,       )

       return (
           config,
           input_ids,
           attention_mask,
           lm_labels,
       )


     def  _A				( self				:		Optional[Any]    ,       UpperCAmelCase_				:		int    ,       UpperCAmelCase_				:		Dict    ,       UpperCAmelCase_				:		int    ,       UpperCAmelCase_				:		Any    ,       ):
       SCREAMING_SNAKE_CASE				:					str		  =			True
       SCREAMING_SNAKE_CASE				:					Optional[int]		  =			SpeechaTextaDecoder(config=UpperCAmelCase_					).to(UpperCAmelCase_					).eval()
       SCREAMING_SNAKE_CASE				:					Tuple		  =			input_ids[:2]

       input_ids[input_ids == 0] += 1
       # first forward pass
       SCREAMING_SNAKE_CASE				:					Union[str, Any]		  =			model(UpperCAmelCase_    ,       use_cache=UpperCAmelCase_					)
       SCREAMING_SNAKE_CASE				:					List[str]		  =			model(UpperCAmelCase_					)
       SCREAMING_SNAKE_CASE				:					Union[str, Any]		  =			model(UpperCAmelCase_    ,       use_cache=UpperCAmelCase_					)

       self.parent.assertTrue(len(UpperCAmelCase_					) == len(UpperCAmelCase_					)					)
       self.parent.assertTrue(len(UpperCAmelCase_					) == len(UpperCAmelCase_					) + 1					)

       SCREAMING_SNAKE_CASE				:					List[Any]		  =			outputs["past_key_values"]

       # create hypothetical next token and extent to next_input_ids
       SCREAMING_SNAKE_CASE				:					str		  =			ids_tensor((2, 1)    ,       config.vocab_size - 1					) + 1

       # append to next input_ids and
       SCREAMING_SNAKE_CASE				:					str		  =			torch.cat([input_ids, next_tokens]    ,       dim=-1					)

       print(UpperCAmelCase_					)

       SCREAMING_SNAKE_CASE				:					List[str]		  =			model(UpperCAmelCase_					)["last_hidden_state"]
       SCREAMING_SNAKE_CASE				:					Union[str, Any]		  =			model(UpperCAmelCase_    ,       past_key_values=UpperCAmelCase_					)["last_hidden_state"]

       # select random slice
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			ids_tensor((1,)    ,       output_from_past.shape[-1]					).item()
       SCREAMING_SNAKE_CASE				:					str		  =			output_from_no_past[:, next_input_ids.shape[-1] - 1, random_slice_idx].detach()
       SCREAMING_SNAKE_CASE				:					int		  =			output_from_past[:, 0, random_slice_idx].detach()

       # test that outputs are equal for slice
       assert torch.allclose(UpperCAmelCase_    ,       UpperCAmelCase_    ,       atol=1E-3					)






     def  _A				( self				:		str					):
       SCREAMING_SNAKE_CASE				:					int		  =			self.prepare_config_and_inputs()
       (
           (
           SCREAMING_SNAKE_CASE
       )  ,     (
           SCREAMING_SNAKE_CASE
       )  ,     (
           SCREAMING_SNAKE_CASE
       )  ,     (
           SCREAMING_SNAKE_CASE
       )  ,     
       )				:					Optional[Any]		  =			config_and_inputs

       SCREAMING_SNAKE_CASE				:					Optional[Any]		  =			{
           "input_ids": input_ids,
           "attention_mask": attention_mask,
       }
       return config, inputs_dict





@require_torch
class        SCREAMING_SNAKE_CASE	(	lowerCAmelCase					,						lowerCAmelCase					,						lowerCAmelCase					,						unittest.TestCase    ):
     '''simple docstring'''


     UpperCamelCase_							:						int								=		(SpeechaTextaDecoder, SpeechaTextaForCausalLM) if is_torch_available() else ()
     UpperCamelCase_							:						Tuple								=		(SpeechaTextaForCausalLM,) if is_torch_available() else ()
     UpperCamelCase_							:						int								=		{'''text-generation''': SpeechaTextaForCausalLM} if is_torch_available() else {}
     UpperCamelCase_							:						Tuple								=		True
     UpperCamelCase_							:						Union[str, Any]								=		False


     def  _A				( self				:		Tuple    ,       ):
       SCREAMING_SNAKE_CASE				:					Any		  =			SpeechaTextaStandaloneDecoderModelTester(self    ,       is_training=UpperCAmelCase_					)
       SCREAMING_SNAKE_CASE				:					Optional[int]		  =			ConfigTester(self    ,       config_class=UpperCAmelCase_					)


     def  _A				( self				:		Optional[Any]					):
       pass


     def  _A				( self				:		str					):
       pass


     def  _A				( self				:		Dict					):
       pass


     def  _A				( self				:		Optional[Any]					):
       self.config_tester.run_common_tests()


     def  _A				( self				:		Optional[int]					):
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_decoder_model_past(*UpperCAmelCase_					)






     def  _A				( self				:		Optional[int]					):
       return






