




import argparse
import glob
import inspect
import os
import re
import unittest

from get_test_info import get_test_classes

from tests.test_pipeline_mixin import pipeline_test_mapping


__lowerCAmelCase		:    Optional[int]	      =		{}
for task, _ in pipeline_test_mapping.items():
		__lowerCAmelCase		:    Union[str, Any]	      =		{'pt': None, 'tf': None}


# DO **NOT** add item to this set (unless the reason is approved)
__lowerCAmelCase		:    Optional[int]	      =		{
    'tests/models/esm/test_modeling_esmfold.py',  # The pipeline test mapping is added to `test_modeling_esm.py`
}




def       __magic_name__    (			A		: List[str]       ):






			'''simple docstring'''







			if "ModelTesterMixin" in [x.__name__ for x in test_class.__bases__]:
						return "pt"
			elif "TFModelTesterMixin" in [x.__name__ for x in test_class.__bases__]:
						return "tf"
			elif "FlaxModelTesterMixin" in [x.__name__ for x in test_class.__bases__]:
						return "flax"
			else:
						return None




def       __magic_name__    (			A		: Union[str, Any],  A		: int       ):






			'''simple docstring'''







			if PIPELINE_TEST_MAPPING[task].get(A,  A       ) is not None:
						return PIPELINE_TEST_MAPPING[task][framework]

			a   =      pipeline_test_mapping[task]["test"]
			a   =      None

			if framework == "pt":
						a   =      getattr(A,  "model_mapping",  A       )
			elif framework == "tf":
						a   =      getattr(A,  "tf_model_mapping",  A       )

			if mapping is not None:
						a   =      dict(mapping.items()       )

			# cache the results
			a   =      mapping
			return mapping




def       __magic_name__    (			A		: Optional[int],  A		: Union[str, Any]       ):






			'''simple docstring'''







			a   =      get_framework(A       )
			if framework is None:
						return None
			a   =      get_mapping_for_task(A,  A       )
			if mapping is None:
						return None

			a   =      list({model_class.config_class for model_class in test_class.all_model_classes}       )
			if len(A       ) != 1:
						raise ValueError("There should be exactly one configuration class from `test_class.all_model_classes`."       )

			# This could be a list/tuple of model classes, but it's rare.
			a   =      mapping.get(config_classes[0],  A       )
			if isinstance(A,  (tuple, list)       ):
						a   =      sorted(A,  key=lambda A       : x.__name__       )

			return model_class




def       __magic_name__    (			A		: List[Any]       ):






			'''simple docstring'''







			a   =      [(task, get_model_for_pipeline_test(A,  A       )) for task in pipeline_test_mapping]
			a   =      sorted([(task, model) for task, model in mapping if model is not None],  key=lambda A       : x[0]       )

			return dict(A       )




def       __magic_name__    (			A		: List[str]       ):






			'''simple docstring'''







			a   =      get_framework(A       )
			if framework == "pt":
						a   =      "torch"
			a   =      "{}"

			a   =      get_pipeline_model_mapping(A       )
			if len(A       ) == 0:
						return ""

			a   =      []
			for task, model_classes in mapping.items():
						if isinstance(A,  (tuple, list)       ):
									# A list/tuple of model classes
									a   =      "(" + ", ".join([x.__name__ for x in model_classes]       ) + ")"
						else:
									# A single model class
									a   =      model_classes.__name__
						texts.append(F"""\"{task}\": {value}"""       )
			a   =      "{" + ", ".join(A       ) + "}"
			a   =      F"""pipeline_model_mapping = {text} if is_{framework}_available() else {default_value}"""

			return text




def       __magic_name__    (			A		: Any       ):






			'''simple docstring'''







			a   =      {"ModelTesterMixin", "TFModelTesterMixin", "FlaxModelTesterMixin"}
			if not issubclass(A,  unittest.TestCase       ):
						return False
			return len(base_class_names.intersection([x.__name__ for x in test_class.__bases__]       )       ) > 0




def       __magic_name__    (			A		: str       ):






			'''simple docstring'''







			a   =      [x for x in get_test_classes(A       ) if is_valid_test_class(A       )]

			a   =      None
			for test_class in test_classes:
						# If a test class has defined `pipeline_model_mapping`, let's take it
						if getattr(A,  "pipeline_model_mapping",  A       ) is not None:
									a   =      test_class
									break
    # Take the test class with the shortest name (just a heuristic)
			if target_test_class is None and len(A       ) > 0:
						a   =      sorted(A,  key=lambda A       : (len(x.__name__       ), x.__name__)       )[0]

			return target_test_class




def       __magic_name__    (			A		: Optional[int],  A		: List[str],  A		: Optional[int]       ):






			'''simple docstring'''







			a   =      start_idx
			for idx, line in enumerate(lines[start_idx:]       ):
						a   =      len(A       ) - len(line.lstrip()       )
						if idx == 0 or indent > indent_level or (indent == indent_level and line.strip() == ")"):
									a   =      start_idx + idx
						elif idx > 0 and indent <= indent_level:
									# Outside the definition block of `pipeline_model_mapping`
									break

			return end_idx




def       __magic_name__    (			A		: List[Any],  A		: int=False       ):






			'''simple docstring'''







			if getattr(A,  "pipeline_model_mapping",  A       ) is not None:
						if not overwrite:
									return "", -1

			a   =      get_pipeline_model_mapping_string(A       )
			if len(A       ) == 0:
						return "", -1
			a   =      line_to_add + "\n"

			# The code defined the class `test_class`
			a   ,		a   =      inspect.getsourcelines(A       )
			# `inspect` gives the code for an object, including decorator(s) if any.
			# We (only) need the exact line of the class definition.
			for idx, line in enumerate(A       ):
						if line.lstrip().startswith("class "       ):
									a   =      class_lines[idx:]
									class_start_line_no += idx
									break
			a   =      class_start_line_no + len(A       ) - 1

			# The index in `class_lines` that starts the definition of `all_model_classes`, `all_generative_model_classes` or
			# `pipeline_model_mapping`. This assumes they are defined in such order, and we take the start index of the last
			# block that appears in a `test_class`.
			a   =      None
			# The indent level of the line at `class_lines[start_idx]` (if defined)
			a   =      0
			# To record if `pipeline_model_mapping` is found in `test_class`.
			a   =      None
			for idx, line in enumerate(A       ):
						if line.strip().startswith("all_model_classes = "       ):
									a   =      len(A       ) - len(line.lstrip()       )
									a   =      idx
						elif line.strip().startswith("all_generative_model_classes = "       ):
									a   =      len(A       ) - len(line.lstrip()       )
									a   =      idx
						elif line.strip().startswith("pipeline_model_mapping = "       ):
									a   =      len(A       ) - len(line.lstrip()       )
									a   =      idx
									a   =      line
									break

			if start_idx is None:
						return "", -1
			# Find the ending index (inclusive) of the above found block.
			a   =      find_block_ending(A,  A,  A       )

			# Extract `is_xxx_available()` from existing blocks: some models require specific libraries like `timm` and use
			# `is_timm_available()` instead of `is_torch_available()`.
			# Keep leading and trailing whitespaces
			a   =      re.compile(R"\s(is_\S+?_available\(\))\s"       )
			for line in class_lines[start_idx : end_idx + 1]:
						a   =      r.search(A       )
						if backend_condition is not None:
									# replace the leading and trailing whitespaces to the space character " ".
									a   =      " " + backend_condition[0][1:-1] + " "
									a   =      r.sub(A,  A       )
									break

			if def_line is None:
						# `pipeline_model_mapping` is not defined. The target index is set to the ending index (inclusive) of
						# `all_model_classes` or `all_generative_model_classes`.
						a   =      end_idx
			else:
						# `pipeline_model_mapping` is defined. The target index is set to be one **BEFORE** its start index.
						a   =      start_idx - 1
						# mark the lines of the currently existing `pipeline_model_mapping` to be removed.
						for idx in range(A,  end_idx + 1       ):
									# These lines are going to be removed before writing to the test file.
									a   =      None  # noqa

    # Make sure the test class is a subclass of `PipelineTesterMixin`.
			a   =      [x.__name__ for x in test_class.__bases__]
			if "PipelineTesterMixin" not in parent_classes:
						# Put `PipelineTesterMixin` just before `unittest.TestCase`
						a   =      [x for x in parent_classes if x != "TestCase"] + ["PipelineTesterMixin"]
						if "TestCase" in parent_classes:
									# Here we **assume** the original string is always with `unittest.TestCase`.
									_parent_classes.append("unittest.TestCase"       )
						a   =      ", ".join(_parent_classes       )
						for idx, line in enumerate(A       ):
									# Find the ending of the declaration of `test_class`
									if line.strip().endswith("):"       ):
												# mark the lines of the declaration of `test_class` to be removed
												for _idx in range(idx + 1       ):
															a   =      None  # noqa
												break
        # Add the new, one-line, class declaration for `test_class`
						a   =      F"""class {test_class.__name__}({parent_classes}):\n"""

			# Add indentation
			a   =      " " * indent_level + line_to_add
			# Insert `pipeline_model_mapping` to `class_lines`.
			# (The line at `target_idx` should be kept by definition!)
			a   =      class_lines[: target_idx + 1] + [line_to_add] + class_lines[target_idx + 1 :]
			# Remove the lines that are marked to be removed
			a   =      [x for x in class_lines if x is not None]

			# Move from test class to module (in order to write to the test file)
			a   =      inspect.getsourcelines(inspect.getmodule(A       )       )[0]
			# Be careful with the 1-off between line numbers and array indices
			a   =      module_lines[: class_start_line_no - 1] + class_lines + module_lines[class_end_line_no:]
			a   =      "".join(A       )

			a   =      inspect.getsourcefile(A       )
			with open(A,  "w",  encoding="UTF-8",  newline="\n"       ) as fp:
						fp.write(A       )

			return line_to_add




def       __magic_name__    (			A		: str,  A		: Union[str, Any]=False       ):






			'''simple docstring'''







			a   =      find_test_class(A       )
			if test_class:
						add_pipeline_model_mapping(A,  overwrite=A       )


if __name__ == "__main__":
		__lowerCAmelCase		:    Optional[Any]	      =		argparse.ArgumentParser()
		parser.add_argument(
		    '--test_file', type=str, help='A path to the test file, starting with the repository\'s `tests` directory.'
		)
		parser.add_argument(
		    '--all',
		    action='store_true',
		    help='If to check and modify all test files.',
		)
		parser.add_argument(
		    '--overwrite',
		    action='store_true',
		    help='If to overwrite a test class if it has already defined `pipeline_model_mapping`.',
		)
		__lowerCAmelCase		:    int	      =		parser.parse_args()

		if not args.all and not args.test_file:
				raise ValueError('Please specify either `test_file` or pass `--all` to check/modify all test files.')
		elif args.all and args.test_file:
				raise ValueError('Only one of `--test_file` and `--all` could be specified.')

		__lowerCAmelCase		:    Optional[Any]	      =		[]
		if args.test_file:
				__lowerCAmelCase		:    Dict	      =		[args.test_file]
		else:
				__lowerCAmelCase		:    str	      =		os.path.join('tests', 'models', '**', 'test_modeling_*.py')
				for test_file in glob.glob(pattern):
						# `Flax` is not concerned at this moment
						if not test_file.startswith('test_modeling_flax_'):
								test_files.append(test_file)

		for test_file in test_files:
				if test_file in TEST_FILE_TO_IGNORE:
						print(F'''[SKIPPED] {test_file} is skipped as it is in `TEST_FILE_TO_IGNORE` in the file {__file__}.''')
						continue
				add_pipeline_model_mapping_to_test_file(test_file, overwrite=args.overwrite)












from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import TensorType, is_torch_available, logging


__lowerCAmelCase		:    Dict	      =		logging.get_logger(__name__)

__lowerCAmelCase		:    Optional[int]	      =		{
    'facebook/mbart-large-cc25': 'https://huggingface.co/facebook/mbart-large-cc25/resolve/main/config.json',
    # See all MBART models at https://huggingface.co/models?filter=mbart
}




class    snake_case__							(_UpperCamelCase       ):
				"""simple docstring"""



				SCREAMING_SNAKE_CASE_	:							int										= """mbart"""
				SCREAMING_SNAKE_CASE_	:							Optional[Any]										= ["""past_key_values"""]
				SCREAMING_SNAKE_CASE_	:							Any										= {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}





				def __init__(				self    :					List[Any] ,				__lowerCamelCase    :					str=5_02_65 ,				__lowerCamelCase    :					List[Any]=10_24 ,				__lowerCamelCase    :					Optional[Any]=12 ,				__lowerCamelCase    :					List[Any]=40_96 ,				__lowerCamelCase    :					int=16 ,				__lowerCamelCase    :					List[Any]=12 ,				__lowerCamelCase    :					Tuple=40_96 ,				__lowerCamelCase    :					Tuple=16 ,				__lowerCamelCase    :					Optional[Any]=0.0 ,				__lowerCamelCase    :					int=0.0 ,				__lowerCamelCase    :					Any=True ,				__lowerCamelCase    :					List[Any]=True ,				__lowerCamelCase    :					str="gelu" ,				__lowerCamelCase    :					Tuple=10_24 ,				__lowerCamelCase    :					Any=0.1 ,				__lowerCamelCase    :					Dict=0.0 ,				__lowerCamelCase    :					Tuple=0.0 ,				__lowerCamelCase    :					Optional[int]=0.02 ,				__lowerCamelCase    :					Dict=0.0 ,				__lowerCamelCase    :					Union[str, Any]=False ,				__lowerCamelCase    :					Optional[int]=1 ,				__lowerCamelCase    :					Tuple=0 ,				__lowerCamelCase    :					List[Any]=2 ,				__lowerCamelCase    :					Dict=2 ,				**__lowerCamelCase    :					Optional[int] ,				) ->					Optional[int]:
							a   =      vocab_size
							a   =      max_position_embeddings
							a   =      d_model
							a   =      encoder_ffn_dim
							a   =      encoder_layers
							a   =      encoder_attention_heads
							a   =      decoder_ffn_dim
							a   =      decoder_layers
							a   =      decoder_attention_heads
							a   =      dropout
							a   =      attention_dropout
							a   =      activation_dropout
							a   =      activation_function
							a   =      init_std
							a   =      encoder_layerdrop
							a   =      decoder_layerdrop
							a   =      classifier_dropout
							a   =      use_cache
							a   =      encoder_layers
							a   =      scale_embedding  # scale factor will be sqrt(d_model) if True
							super().__init__(
							    pad_token_id=__lowerCamelCase ,				bos_token_id=__lowerCamelCase ,				eos_token_id=__lowerCamelCase ,				is_encoder_decoder=__lowerCamelCase ,				forced_eos_token_id=__lowerCamelCase ,				**__lowerCamelCase ,				)




class    snake_case__							(_UpperCamelCase       ):
				"""simple docstring"""



				@property
				def 							__UpperCAmelCase							(				self    :					Optional[Any]							) ->					Mapping[str, Mapping[int, str]]:
							if self.task in ["default", "seq2seq-lm"]:
										a   =      OrderedDict(
										    [
										        ("input_ids", {0: "batch", 1: "encoder_sequence"}),
										        ("attention_mask", {0: "batch", 1: "encoder_sequence"}),
										    ]							)

										if self.use_past:
													a   =      {0: "batch"}
													a   =      {0: "batch", 1: "past_decoder_sequence + sequence"}
										else:
													a   =      {0: "batch", 1: "decoder_sequence"}
													a   =      {0: "batch", 1: "decoder_sequence"}

										if self.use_past:
													self.fill_with_past_key_values_(__lowerCamelCase ,				direction="inputs"							)
							elif self.task == "causal-lm":
										# TODO: figure this case out.
										a   =      OrderedDict(
										    [
										        ("input_ids", {0: "batch", 1: "encoder_sequence"}),
										        ("attention_mask", {0: "batch", 1: "encoder_sequence"}),
										    ]							)
										if self.use_past:
													a   ,		a   =      self.num_layers
													for i in range(__lowerCamelCase							):
																a   =      {0: "batch", 2: "past_sequence + sequence"}
																a   =      {0: "batch", 2: "past_sequence + sequence"}
							else:
										a   =      OrderedDict(
										    [
										        ("input_ids", {0: "batch", 1: "encoder_sequence"}),
										        ("attention_mask", {0: "batch", 1: "encoder_sequence"}),
										        ("decoder_input_ids", {0: "batch", 1: "decoder_sequence"}),
										        ("decoder_attention_mask", {0: "batch", 1: "decoder_sequence"}),
										    ]							)

							return common_inputs





				@property
				def 							__UpperCAmelCase							(				self    :					Any							) ->					Mapping[str, Mapping[int, str]]:
							if self.task in ["default", "seq2seq-lm"]:
										a   =      super().outputs
							else:
										a   =      super(__lowerCamelCase ,				self							).outputs
										if self.use_past:
													a   ,		a   =      self.num_layers
													for i in range(__lowerCamelCase							):
																a   =      {0: "batch", 2: "past_sequence + sequence"}
																a   =      {0: "batch", 2: "past_sequence + sequence"}
							return common_outputs





				def 							__UpperCAmelCase							(				self    :					Union[str, Any] ,				__lowerCamelCase    :					PreTrainedTokenizer ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					bool = False ,				__lowerCamelCase    :					Optional[TensorType] = None ,				) ->					Mapping[str, Any]:
							a   =      self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase							)

							# Generate decoder inputs
							a   =      seq_length if not self.use_past else 1
							a   =      self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase							)
							a   =      {f"""decoder_{name}""": tensor for name, tensor in decoder_inputs.items()}
							a   =      dict(**__lowerCamelCase ,				**__lowerCamelCase							)

							if self.use_past:
										if not is_torch_available():
													raise ValueError("Cannot generate dummy past_keys inputs without PyTorch installed."							)
										else:
													import torch
										a   ,		a   =      common_inputs["input_ids"].shape
										a   =      common_inputs["decoder_input_ids"].shape[1]
										a   ,		a   =      self.num_attention_heads
										a   =      (
										    batch,
										    num_encoder_attention_heads,
										    encoder_seq_length,
										    self._config.hidden_size // num_encoder_attention_heads,
										)
										a   =      decoder_seq_length + 3
										a   =      (
										    batch,
										    num_decoder_attention_heads,
										    decoder_past_length,
										    self._config.hidden_size // num_decoder_attention_heads,
										)

										a   =      torch.cat(
										    [common_inputs["decoder_attention_mask"], torch.ones(__lowerCamelCase ,				__lowerCamelCase							)] ,				dim=1							)

										a   =      []
										# If the number of encoder and decoder layers are present in the model configuration, both are considered
										a   ,		a   =      self.num_layers
										a   =      min(__lowerCamelCase ,				__lowerCamelCase							)
										a   =      max(__lowerCamelCase ,				__lowerCamelCase							) - min_num_layers
										a   =      "encoder" if num_encoder_layers > num_decoder_layers else "decoder"

										for _ in range(__lowerCamelCase							):
													common_inputs["past_key_values"].append(
													    (
													        torch.zeros(__lowerCamelCase							),
													        torch.zeros(__lowerCamelCase							),
													        torch.zeros(__lowerCamelCase							),
													        torch.zeros(__lowerCamelCase							),
													    )							)
										# TODO: test this.
										a   =      encoder_shape if remaining_side_name == "encoder" else decoder_shape
										for _ in range(__lowerCamelCase ,				__lowerCamelCase							):
													common_inputs["past_key_values"].append((torch.zeros(__lowerCamelCase							), torch.zeros(__lowerCamelCase							))							)
							return common_inputs





				def 							__UpperCAmelCase							(				self    :					str ,				__lowerCamelCase    :					PreTrainedTokenizer ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					bool = False ,				__lowerCamelCase    :					Optional[TensorType] = None ,				) ->					Mapping[str, Any]:
							a   =      self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    __lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase							)

							if self.use_past:
										if not is_torch_available():
													raise ValueError("Cannot generate dummy past_keys inputs without PyTorch installed."							)
										else:
													import torch
										a   ,		a   =      common_inputs["input_ids"].shape
										# Not using the same length for past_key_values
										a   =      seqlen + 2
										a   ,		a   =      self.num_layers
										a   ,		a   =      self.num_attention_heads
										a   =      (
										    batch,
										    num_encoder_attention_heads,
										    past_key_values_length,
										    self._config.hidden_size // num_encoder_attention_heads,
										)

										a   =      common_inputs["attention_mask"].dtype
										a   =      torch.cat(
										    [common_inputs["attention_mask"], torch.ones(__lowerCamelCase ,				__lowerCamelCase ,				dtype=__lowerCamelCase							)] ,				dim=1							)
										a   =      [
										    (torch.zeros(__lowerCamelCase							), torch.zeros(__lowerCamelCase							)) for _ in range(__lowerCamelCase							)
										]
							return common_inputs





				def 							__UpperCAmelCase							(				self    :					Union[str, Any] ,				__lowerCamelCase    :					PreTrainedTokenizer ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					bool = False ,				__lowerCamelCase    :					Optional[TensorType] = None ,				) ->					Mapping[str, Any]:
							# Copied from OnnxConfig.generate_dummy_inputs
							# Did not use super(OnnxConfigWithPast, self).generate_dummy_inputs for code clarity.
							# If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
							a   =      compute_effective_axis_dimension(
							    __lowerCamelCase ,				fixed_dimension=OnnxConfig.default_fixed_batch ,				num_token_to_add=0							)

							# If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
							a   =      tokenizer.num_special_tokens_to_add(__lowerCamelCase							)
							a   =      compute_effective_axis_dimension(
							    __lowerCamelCase ,				fixed_dimension=OnnxConfig.default_fixed_sequence ,				num_token_to_add=__lowerCamelCase							)

							# Generate dummy inputs according to compute batch and sequence
							a   =      [" ".join([tokenizer.unk_token]							) * seq_length] * batch_size
							a   =      dict(tokenizer(__lowerCamelCase ,				return_tensors=__lowerCamelCase							)							)
							return common_inputs





				def 							__UpperCAmelCase							(				self    :					str ,				__lowerCamelCase    :					PreTrainedTokenizer ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					int = -1 ,				__lowerCamelCase    :					bool = False ,				__lowerCamelCase    :					Optional[TensorType] = None ,				) ->					Mapping[str, Any]:
							if self.task in ["default", "seq2seq-lm"]:
										a   =      self._generate_dummy_inputs_for_default_and_seqaseq_lm(
										    __lowerCamelCase ,				batch_size=__lowerCamelCase ,				seq_length=__lowerCamelCase ,				is_pair=__lowerCamelCase ,				framework=__lowerCamelCase							)

							elif self.task == "causal-lm":
										a   =      self._generate_dummy_inputs_for_causal_lm(
										    __lowerCamelCase ,				batch_size=__lowerCamelCase ,				seq_length=__lowerCamelCase ,				is_pair=__lowerCamelCase ,				framework=__lowerCamelCase							)
							else:
										a   =      self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
										    __lowerCamelCase ,				batch_size=__lowerCamelCase ,				seq_length=__lowerCamelCase ,				is_pair=__lowerCamelCase ,				framework=__lowerCamelCase							)

							return common_inputs





				def 							__UpperCAmelCase							(				self    :					Optional[int] ,				__lowerCamelCase    :					Union[str, Any] ,				__lowerCamelCase    :					int ,				__lowerCamelCase    :					str ,				__lowerCamelCase    :					Optional[Any]							) ->					Dict:
							if self.task in ["default", "seq2seq-lm"]:
										a   =      super()._flatten_past_key_values_(__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase							)
							else:
										a   =      super(__lowerCamelCase ,				self							)._flatten_past_key_values_(
										    __lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase							)






