






from __future__ import annotations

import unittest

import numpy as np

from transformers import OPTConfig, is_tf_available
from transformers.testing_utils import require_sentencepiece, 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 GPTaTokenizer, TFOPTForCausalLM, TFOPTModel






def      _snake_case     (__lowercase     ,   __lowercase     ,   __lowercase=None     ,   __lowercase=None):
   if attention_mask is None:
      UpperCamelCase_						=  tf.cast(tf.math.not_equal(__lowercase     ,   config.pad_token_id)     ,   tf.inta)
   return {"input_ids": input_ids, "attention_mask": attention_mask}


@require_tf
class     _a							:






  """simple docstring"""





  A_						       = OPTConfig
  A_						       = {}
  A_						       = """gelu"""




  def __init__(  self		,		_UpperCAmelCase		,		_UpperCAmelCase=13		,		_UpperCAmelCase=7		,		_UpperCAmelCase=True		,		_UpperCAmelCase=False		,		_UpperCAmelCase=99		,		_UpperCAmelCase=16		,		_UpperCAmelCase=2		,		_UpperCAmelCase=4		,		_UpperCAmelCase=4		,		_UpperCAmelCase="gelu"		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=20		,		_UpperCAmelCase=2		,		_UpperCAmelCase=1		,		_UpperCAmelCase=0		,		_UpperCAmelCase=16		,		_UpperCAmelCase=16		,		)      ->			Optional[int]:
     UpperCamelCase_						=  parent
     UpperCamelCase_						=  batch_size
     UpperCamelCase_						=  seq_length
     UpperCamelCase_						=  is_training
     UpperCamelCase_						=  use_labels
     UpperCamelCase_						=  vocab_size
     UpperCamelCase_						=  hidden_size
     UpperCamelCase_						=  num_hidden_layers
     UpperCamelCase_						=  num_attention_heads
     UpperCamelCase_						=  intermediate_size
     UpperCamelCase_						=  hidden_act
     UpperCamelCase_						=  hidden_dropout_prob
     UpperCamelCase_						=  attention_probs_dropout_prob
     UpperCamelCase_						=  max_position_embeddings
     UpperCamelCase_						=  eos_token_id
     UpperCamelCase_						=  pad_token_id
     UpperCamelCase_						=  bos_token_id
     UpperCamelCase_						=  embed_dim
     UpperCamelCase_						=  word_embed_proj_dim
     UpperCamelCase_						=  False




  def  _UpperCAmelCase  (  self			)      ->			Optional[Any]:
     UpperCamelCase_						=  ids_tensor([self.batch_size, self.seq_length - 1]		,		self.vocab_size			)
     UpperCamelCase_						=  tf.expand_dims(tf.constant([self.eos_token_id] * self.batch_size			)		,		1			)
     UpperCamelCase_						=  tf.concat([input_ids, eos_tensor]		,		axis=1			)

     UpperCamelCase_						=  self.config_cls(
         vocab_size=self.vocab_size		,		hidden_size=self.hidden_size		,		num_hidden_layers=self.num_hidden_layers		,		num_attention_heads=self.num_attention_heads		,		ffn_dim=self.intermediate_size		,		dropout=self.hidden_dropout_prob		,		attention_dropout=self.attention_probs_dropout_prob		,		max_position_embeddings=self.max_position_embeddings		,		eos_token_id=self.eos_token_id		,		bos_token_id=self.bos_token_id		,		pad_token_id=self.pad_token_id		,		embed_dim=self.embed_dim		,		word_embed_proj_dim=self.word_embed_proj_dim		,		is_encoder_decoder=_UpperCAmelCase		,		**self.config_updates		,		)
     UpperCamelCase_						=  prepare_opt_inputs_dict(_UpperCAmelCase		,		_UpperCAmelCase			)
     return config, inputs_dict




  def  _UpperCAmelCase  (  self		,		_UpperCAmelCase		,		_UpperCAmelCase			)      ->			List[str]:
     UpperCamelCase_						=  TFOPTModel(config=_UpperCAmelCase			)
     UpperCamelCase_						=  inputs_dict['input_ids']

     UpperCamelCase_						=  input_ids[:1, :]
     UpperCamelCase_						=  inputs_dict['attention_mask'][:1, :]
     UpperCamelCase_						=  1

     # first forward pass
     UpperCamelCase_						=  model(_UpperCAmelCase		,		attention_mask=_UpperCAmelCase		,		use_cache=_UpperCAmelCase			)

     UpperCamelCase_		,   UpperCamelCase_						=  outputs.to_tuple()

     # create hypothetical next token and extent to next_input_ids
     UpperCamelCase_						=  ids_tensor((self.batch_size, 3)		,		config.vocab_size			)
     UpperCamelCase_						=  tf.cast(ids_tensor((self.batch_size, 3)		,		2			)		,		tf.inta			)

     # append to next input_ids and
     UpperCamelCase_						=  tf.concat([input_ids, next_tokens]		,		axis=-1			)
     UpperCamelCase_						=  tf.concat([attention_mask, next_attn_mask]		,		axis=-1			)

     UpperCamelCase_						=  model(_UpperCAmelCase		,		attention_mask=_UpperCAmelCase			)[0]
     UpperCamelCase_						=  model(_UpperCAmelCase		,		attention_mask=_UpperCAmelCase		,		past_key_values=_UpperCAmelCase			)[0]

     self.parent.assertEqual(next_tokens.shape[1]		,		output_from_past.shape[1]			)

     # select random slice
     UpperCamelCase_						=  int(ids_tensor((1,)		,		output_from_past.shape[-1]			)			)
     UpperCamelCase_						=  output_from_no_past[:, -3:, random_slice_idx]
     UpperCamelCase_						=  output_from_past[:, :, random_slice_idx]

     # test that outputs are equal for slice
     tf.debugging.assert_near(_UpperCAmelCase		,		_UpperCAmelCase		,		rtol=1e-3			)




@require_tf
class     _a							(	UpperCAmelCase__    ,							UpperCAmelCase__    ,							unittest.TestCase     ):






  """simple docstring"""





  A_						       = (TFOPTModel, TFOPTForCausalLM) if is_tf_available() else ()
  A_						       = (TFOPTForCausalLM,) if is_tf_available() else ()
  A_						       = (
      {"""feature-extraction""": TFOPTModel, """text-generation""": TFOPTForCausalLM} if is_tf_available() else {}
  )
  A_						       = False
  A_						       = False
  A_						       = False
  A_						       = 10




  def  _UpperCAmelCase  (  self			)      ->			Optional[Any]:
     UpperCamelCase_						=  TFOPTModelTester(self			)
     UpperCamelCase_						=  ConfigTester(self		,		config_class=_UpperCAmelCase			)




  def  _UpperCAmelCase  (  self			)      ->			Dict:
     self.config_tester.run_common_tests()




  def  _UpperCAmelCase  (  self			)      ->			Union[str, Any]:
     UpperCamelCase_						=  self.model_tester.prepare_config_and_inputs_for_common()
     self.model_tester.check_decoder_model_past_large_inputs(*_UpperCAmelCase			)




  def  _UpperCAmelCase  (  self			)      ->			Dict:
     UpperCamelCase_		,   UpperCamelCase_						=  self.model_tester.prepare_config_and_inputs_for_common()

     def _get_word_embedding_weight(_UpperCAmelCase		,		_UpperCAmelCase			):
        if hasattr(_UpperCAmelCase		,		'weight'			):
           return embedding_layer.weight
        else:
           # Here we build the word embeddings weights if not exists.
           # And then we retry to get the attribute once built.
           model.build()
           if hasattr(_UpperCAmelCase		,		'weight'			):
              return embedding_layer.weight
           else:
              return None

     for model_class in self.all_model_classes:
        for size in [config.vocab_size - 10, config.vocab_size + 10]:
           # build the embeddings
           UpperCamelCase_						=  model_class(config=_UpperCAmelCase			)
           UpperCamelCase_						=  _get_word_embedding_weight(_UpperCAmelCase		,		model.get_input_embeddings()			)
           UpperCamelCase_						=  _get_word_embedding_weight(_UpperCAmelCase		,		model.get_output_embeddings()			)

           # reshape the embeddings
           model.resize_token_embeddings(_UpperCAmelCase			)
           UpperCamelCase_						=  _get_word_embedding_weight(_UpperCAmelCase		,		model.get_input_embeddings()			)
           UpperCamelCase_						=  _get_word_embedding_weight(_UpperCAmelCase		,		model.get_output_embeddings()			)

           # check that the resized embeddings size matches the desired size.
           UpperCamelCase_						=  size if size is not None else config.vocab_size

           self.assertEqual(new_input_embeddings.shape[0]		,		_UpperCAmelCase			)

           # check that weights remain the same after resizing
           UpperCamelCase_						=  True
           for pa, pa in zip(old_input_embeddings.value()		,		new_input_embeddings.value()			):
              if tf.math.reduce_sum(tf.math.abs(pa - pa			)			) > 0:
                 UpperCamelCase_						=  False
           self.assertTrue(_UpperCAmelCase			)

           if old_output_embeddings is not None and new_output_embeddings is not None:
              self.assertEqual(new_output_embeddings.shape[0]		,		_UpperCAmelCase			)

              UpperCamelCase_						=  True
              for pa, pa in zip(old_output_embeddings.value()		,		new_output_embeddings.value()			):
                 if tf.math.reduce_sum(tf.math.abs(pa - pa			)			) > 0:
                    UpperCamelCase_						=  False
              self.assertTrue(_UpperCAmelCase			)






def      _snake_case     (__lowercase):
   return tf.constant(__lowercase     ,   dtype=tf.intaa)


@require_tf
class     _a							(	unittest.TestCase     ):






  """simple docstring"""





  A_						       = 99




  def  _UpperCAmelCase  (  self			)      ->			List[str]:
     UpperCamelCase_						=  tf.ones((4, 1)		,		dtype=tf.intaa			) * 2
     UpperCamelCase_						=  tf.concat([ids_tensor((4, 6)		,		self.vocab_size - 3			) + 3, eos_column_vector]		,		axis=1			)
     UpperCamelCase_						=  input_ids.shape[0]
     UpperCamelCase_						=  OPTConfig(
         vocab_size=self.vocab_size		,		hidden_size=24		,		num_hidden_layers=2		,		num_attention_heads=2		,		ffn_dim=32		,		max_position_embeddings=48		,		eos_token_id=2		,		pad_token_id=1		,		bos_token_id=0		,		)
     return config, input_ids, batch_size




@require_sentencepiece
@require_tf
class     _a							(	unittest.TestCase     ):






  """simple docstring"""





  @slow
  def  _UpperCAmelCase  (  self			)      ->			Dict:
     UpperCamelCase_						=  TFOPTModel.from_pretrained('facebook/opt-350m'			)
     UpperCamelCase_						=  _long_tensor([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]]			)
     UpperCamelCase_						=  tf.not_equal(_UpperCAmelCase		,		model.config.pad_token_id			)
     with tf.GradientTape():
        UpperCamelCase_						=  model(input_ids=_UpperCAmelCase		,		attention_mask=_UpperCAmelCase			).last_hidden_state
     UpperCamelCase_						=  (1, 11, 512)
     self.assertEqual(output.shape		,		_UpperCAmelCase			)
     UpperCamelCase_						=  tf.constant(
         [[-0.2_8_7_3, -1.9_2_1_8, -0.3_0_3_3], [-1.2_7_1_0, -0.1_3_3_8, -0.1_9_0_2], [0.4_0_9_5, 0.1_2_1_4, -1.3_1_2_1]]			)
     self.assertTrue(np.allclose(output[:, :3, :3]		,		_UpperCAmelCase		,		atol=4e-3			)			)

     UpperCamelCase_						=  tf.function(_UpperCAmelCase		,		jit_compile=_UpperCAmelCase			)
     UpperCamelCase_						=  xla_generate(_UpperCAmelCase		,		_UpperCAmelCase			)[0]
     self.assertTrue(np.allclose(output[:, :3, :3]		,		_UpperCAmelCase		,		atol=4e-2			)			)




@require_tf
@slow
class     _a							(	unittest.TestCase     ):






  """simple docstring"""





  def  _UpperCAmelCase  (  self			)      ->			Tuple:
     super().setUp()
     UpperCamelCase_						=  'facebook/opt-350m'




  def  _UpperCAmelCase  (  self			)      ->			Optional[int]:
     UpperCamelCase_						=  TFOPTForCausalLM.from_pretrained(self.path_model			)
     UpperCamelCase_						=  GPTaTokenizer.from_pretrained(self.path_model			)

     UpperCamelCase_						=  [
         'Today is a beautiful day and I want to',
         'In the city of',
         'Paris is the capital of France and',
         'Computers and mobile phones have taken',
     ]
     # verify that prompt without BOS token is identical to Metaseq -> add_special_tokens=False
     UpperCamelCase_						=  tokenizer(_UpperCAmelCase		,		return_tensors='tf'		,		padding=_UpperCAmelCase		,		add_special_tokens=_UpperCAmelCase			)
     UpperCamelCase_						=  tf.math.reduce_mean(model(inputs.input_ids		,		attention_mask=inputs.attention_mask			)[0]		,		axis=-1			)
     UpperCamelCase_						=  tf.constant(
         [
             [1.3_8_5_1, -1_3.8_9_2_3, -1_0.5_2_2_9, -1_0.7_5_3_3, -0.2_3_0_9, -1_0.2_3_8_4, -0.5_3_6_5, -9.0_9_4_7, -5.1_6_7_0],
             [-4.7_0_7_3, -1_0.6_2_7_6, -3.9_4_1_5, -2_1.5_2_4_2, -0.2_8_2_2, -0.2_8_2_2, -0.2_8_2_2, -0.2_8_2_2, -0.2_8_2_2],
             [0.6_2_4_7, -3.4_2_2_9, -8.9_1_7_9, -1.4_2_9_7, -1_4.1_6_5_0, 1.4_1_4_6, -9.0_2_1_8, -0.2_7_0_3, -0.2_7_0_3],
             [6.4_7_8_3, -1.9_9_1_3, -1_0.7_9_2_6, -2.3_3_3_6, 1.5_0_9_2, -0.9_9_7_4, -6.8_2_1_3, 1.3_4_7_7, 1.3_4_7_7],
         ]			)
     self.assertTrue(np.allclose(_UpperCAmelCase		,		_UpperCAmelCase		,		atol=1e-4			)			)

     UpperCamelCase_						=  tf.function(_UpperCAmelCase		,		jit_compile=_UpperCAmelCase			)
     UpperCamelCase_						=  tf.math.reduce_mean(xla_generate(inputs.input_ids		,		attention_mask=inputs.attention_mask			)[0]		,		axis=-1			)
     self.assertTrue(np.allclose(_UpperCAmelCase		,		_UpperCAmelCase		,		atol=1e-4			)			)




@require_tf
@slow
class     _a							(	unittest.TestCase     ):






  """simple docstring"""





  @property
  def  _UpperCAmelCase  (  self			)      ->			Any:
     return [
         "Today is a beautiful day and I want",
         "In the city of",
         "Paris is the capital of France and",
         "Computers and mobile phones have taken",
     ]




  def  _UpperCAmelCase  (  self			)      ->			Any:
     UpperCamelCase_						=  'facebook/opt-125m'

     UpperCamelCase_						=  [
         'Today is a beautiful day and I want to',
         'In the city of New York, the city',
         'Paris is the capital of France and the capital',
         'Computers and mobile phones have taken over the',
     ]

     UpperCamelCase_						=  []
     UpperCamelCase_						=  GPTaTokenizer.from_pretrained(_UpperCAmelCase			)
     UpperCamelCase_						=  TFOPTForCausalLM.from_pretrained(_UpperCAmelCase			)

     for prompt in self.prompts:
        UpperCamelCase_						=  tokenizer(_UpperCAmelCase		,		return_tensors='tf'			).input_ids

        UpperCamelCase_						=  model.generate(_UpperCAmelCase		,		max_length=10			)

        UpperCamelCase_						=  tokenizer.batch_decode(_UpperCAmelCase		,		skip_special_tokens=_UpperCAmelCase			)
        predicted_outputs += generated_string

     self.assertListEqual(_UpperCAmelCase		,		_UpperCAmelCase			)




  def  _UpperCAmelCase  (  self			)      ->			Union[str, Any]:
     UpperCamelCase_						=  'facebook/opt-350m'

     UpperCamelCase_						=  GPTaTokenizer.from_pretrained(_UpperCAmelCase			)
     UpperCamelCase_						=  TFOPTForCausalLM.from_pretrained(_UpperCAmelCase			)

     UpperCamelCase_						=  'left'

     # use different length sentences to test batching
     UpperCamelCase_						=  [
         'Hello, my dog is a little',
         'Today, I',
     ]

     UpperCamelCase_						=  tokenizer(_UpperCAmelCase		,		return_tensors='tf'		,		padding=_UpperCAmelCase			)
     UpperCamelCase_						=  inputs['input_ids']

     UpperCamelCase_						=  model.generate(input_ids=_UpperCAmelCase		,		attention_mask=inputs['attention_mask']			)

     UpperCamelCase_						=  tokenizer(sentences[0]		,		return_tensors='tf'			).input_ids
     UpperCamelCase_						=  model.generate(input_ids=_UpperCAmelCase			)

     UpperCamelCase_						=  inputs_non_padded.shape[-1] - tf.math.reduce_sum(
         tf.cast(inputs['attention_mask'][-1]		,		tf.intaa			)			)
     UpperCamelCase_						=  tokenizer(sentences[1]		,		return_tensors='tf'			).input_ids
     UpperCamelCase_						=  model.generate(input_ids=_UpperCAmelCase		,		max_length=model.config.max_length - num_paddings			)

     UpperCamelCase_						=  tokenizer.batch_decode(_UpperCAmelCase		,		skip_special_tokens=_UpperCAmelCase			)
     UpperCamelCase_						=  tokenizer.decode(output_non_padded[0]		,		skip_special_tokens=_UpperCAmelCase			)
     UpperCamelCase_						=  tokenizer.decode(output_padded[0]		,		skip_special_tokens=_UpperCAmelCase			)

     UpperCamelCase_						=  [
         'Hello, my dog is a little bit of a dork.\nI\'m a little bit',
         'Today, I was in the middle of a conversation with a friend about the',
     ]
     self.assertListEqual(_UpperCAmelCase		,		_UpperCAmelCase			)
     self.assertListEqual(_UpperCAmelCase		,		[non_padded_sentence, padded_sentence]			)




  def  _UpperCAmelCase  (  self			)      ->			int:
     UpperCamelCase_						=  'facebook/opt-350m'

     UpperCamelCase_						=  [
         'Today is a beautiful day and I want to',
         'In the city of San Francisco, the city',
         'Paris is the capital of France and the capital',
         'Computers and mobile phones have taken over the',
     ]

     UpperCamelCase_						=  []
     UpperCamelCase_						=  GPTaTokenizer.from_pretrained(_UpperCAmelCase			)
     UpperCamelCase_						=  TFOPTForCausalLM.from_pretrained(_UpperCAmelCase			)

     for prompt in self.prompts:
        UpperCamelCase_						=  tokenizer(_UpperCAmelCase		,		return_tensors='tf'			).input_ids

        UpperCamelCase_						=  model.generate(_UpperCAmelCase		,		max_length=10			)

        UpperCamelCase_						=  tokenizer.batch_decode(_UpperCAmelCase		,		skip_special_tokens=_UpperCAmelCase			)
        predicted_outputs += generated_string

     self.assertListEqual(_UpperCAmelCase		,		_UpperCAmelCase			)













import copy
from typing import TYPE_CHECKING, Any, Mapping, Optional, OrderedDict

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


if TYPE_CHECKING:
 from ... import PreTrainedTokenizerBase, TensorType

snake_case__   :						List[str]													=   logging.get_logger(__name__)


class     _a							(	UpperCAmelCase__     ):






  """simple docstring"""





  A_						       = """vision-encoder-decoder"""
  A_						       = True




  def __init__(  self		,		**_UpperCAmelCase			)      ->			Dict:
     super().__init__(**_UpperCAmelCase			)
     if "encoder" not in kwargs or "decoder" not in kwargs:
        raise ValueError(
            f"""A configuraton of type {self.model_type} cannot be instantiated because """
            f"""not both `encoder` and `decoder` sub-configurations are passed, but only {kwargs}"""			)

     UpperCamelCase_						=  kwargs.pop('encoder'			)
     UpperCamelCase_						=  encoder_config.pop('model_type'			)
     UpperCamelCase_						=  kwargs.pop('decoder'			)
     UpperCamelCase_						=  decoder_config.pop('model_type'			)

     UpperCamelCase_						=  AutoConfig.for_model(_UpperCAmelCase		,		**_UpperCAmelCase			)
     UpperCamelCase_						=  AutoConfig.for_model(_UpperCAmelCase		,		**_UpperCAmelCase			)
     UpperCamelCase_						=  True




  @classmethod
  def  _UpperCAmelCase  (  cls		,		_UpperCAmelCase		,		_UpperCAmelCase		,		**_UpperCAmelCase			)      ->			PretrainedConfig:
     logger.info('Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'			)
     UpperCamelCase_						=  True
     UpperCamelCase_						=  True

     return cls(encoder=encoder_config.to_dict()		,		decoder=decoder_config.to_dict()		,		**_UpperCAmelCase			)




  def  _UpperCAmelCase  (  self			)      ->			int:
     UpperCamelCase_						=  copy.deepcopy(self.__dict__			)
     UpperCamelCase_						=  self.encoder.to_dict()
     UpperCamelCase_						=  self.decoder.to_dict()
     UpperCamelCase_						=  self.__class__.model_type
     return output




class     _a							(	UpperCAmelCase__     ):






  """simple docstring"""





  A_						       = version.parse("""1.11"""     )




  @property
  def  _UpperCAmelCase  (  self			)      ->			Mapping[str, Mapping[int, str]]:
     return OrderedDict(
         [
             ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
         ]			)




  @property
  def  _UpperCAmelCase  (  self			)      ->			float:
     return 1e-4




  @property
  def  _UpperCAmelCase  (  self			)      ->			Mapping[str, Mapping[int, str]]:
     return OrderedDict({'last_hidden_state': {0: 'batch', 1: 'encoder_sequence'}}			)




class     _a							(	UpperCAmelCase__     ):






  """simple docstring"""





  @property
  def  _UpperCAmelCase  (  self			)      ->			Mapping[str, Mapping[int, str]]:
     UpperCamelCase_						=  OrderedDict()
     UpperCamelCase_						=  {0: 'batch', 1: 'past_decoder_sequence + sequence'}
     UpperCamelCase_						=  {0: 'batch', 1: 'past_decoder_sequence + sequence'}
     UpperCamelCase_						=  {0: 'batch', 1: 'encoder_sequence'}

     return common_inputs




  def  _UpperCAmelCase  (  self		,		_UpperCAmelCase		,		_UpperCAmelCase = -1		,		_UpperCAmelCase = -1		,		_UpperCAmelCase = False		,		_UpperCAmelCase = None		,		)      ->			Mapping[str, Any]:
     import torch

     UpperCamelCase_						=  OrderedDict()

     UpperCamelCase_						=  super().generate_dummy_inputs(
         _UpperCAmelCase		,		batch_size=_UpperCAmelCase		,		seq_length=_UpperCAmelCase		,		is_pair=_UpperCAmelCase		,		framework=_UpperCAmelCase			)

     UpperCamelCase_		,   UpperCamelCase_						=  dummy_input['input_ids'].shape
     UpperCamelCase_						=  (batch, encoder_sequence, self._config.encoder_hidden_size)
     UpperCamelCase_						=  dummy_input.pop('input_ids'			)
     UpperCamelCase_						=  dummy_input.pop('attention_mask'			)
     UpperCamelCase_						=  torch.zeros(_UpperCAmelCase			)

     return common_inputs




class     _a							(	UpperCAmelCase__     ):






  """simple docstring"""





  @property
  def  _UpperCAmelCase  (  self			)      ->			None:
     pass




  def  _UpperCAmelCase  (  self		,		_UpperCAmelCase			)      ->			OnnxConfig:
     return VisionEncoderDecoderEncoderOnnxConfig(_UpperCAmelCase			)




  def  _UpperCAmelCase  (  self		,		_UpperCAmelCase		,		_UpperCAmelCase		,		_UpperCAmelCase = "default"			)      ->			OnnxConfig:
     UpperCamelCase_						=  encoder_config.hidden_size
     return VisionEncoderDecoderDecoderOnnxConfig(_UpperCAmelCase		,		_UpperCAmelCase			)





