

import json
import os
from dataclasses import dataclass
from functools import partial
from typing import Callable

import flax.linen as nn
import jax
import jax.numpy as jnp
import joblib
import optax
import wandb
from flax import jax_utils, struct, traverse_util
from flax.serialization import from_bytes, to_bytes
from flax.training import train_state
from flax.training.common_utils import shard
from tqdm.auto import tqdm

from transformers import BigBirdConfig, FlaxBigBirdForQuestionAnswering
from transformers.models.big_bird.modeling_flax_big_bird import FlaxBigBirdForQuestionAnsweringModule







class        a__       (   UpperCAmelCase       ):







  """simple docstring"""




  UpperCAmelCase__      : BigBirdConfig
  UpperCAmelCase__      : jnp.dtype			       =jnp.floataa
  UpperCAmelCase__      : bool			       =True


  def  _lowercase      (			self    : str		)					->Any:
        """simple docstring"""







        super().setup()
        SCREAMING_SNAKE_CASE :      Optional[Any]       =   nn.Dense(5				,				dtype=self.dtype		)




  def __call__(			self    : int				,				*UpperCAmelCase__    : Optional[int]				,				**UpperCAmelCase__    : Any		)					->Optional[Any]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Any       =   super().__call__(*UpperCAmelCase__				,				**UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Any       =   self.cls(outputs[2]		)
        return outputs[:2] + (cls_out,)







class        a__       (   UpperCAmelCase       ):







  """simple docstring"""




  UpperCAmelCase__      : Tuple			       =FlaxBigBirdForNaturalQuestionsModule






def 					__lowercase      (     _A						,    _A						,    _A						,    _A						,    _A						,    _A			)     ->						Dict:
      def cross_entropy(_A						,    _A						,    _A=None			):
            SCREAMING_SNAKE_CASE :      Union[str, Any]       =   logits.shape[-1]
            SCREAMING_SNAKE_CASE :      Optional[int]       =   (labels[..., None] == jnp.arange(_A			)[None]).astype("""f4"""			)
            SCREAMING_SNAKE_CASE :      Dict       =   jax.nn.log_softmax(_A						,    axis=-1			)
            SCREAMING_SNAKE_CASE :      Union[str, Any]       =   -jnp.sum(labels * logits						,    axis=-1			)
            if reduction is not None:
                  SCREAMING_SNAKE_CASE :      int       =   reduction(_A			)
            return loss

      SCREAMING_SNAKE_CASE :      Optional[int]       =   partial(_A						,    reduction=jnp.mean			)
      SCREAMING_SNAKE_CASE :      str       =   cross_entropy(_A						,    _A			)
      SCREAMING_SNAKE_CASE :      List[str]       =   cross_entropy(_A						,    _A			)
      SCREAMING_SNAKE_CASE :      Optional[int]       =   cross_entropy(_A						,    _A			)
      return (start_loss + end_loss + pooled_loss) / 3







@dataclass
class        a__       :







  """simple docstring"""




  UpperCAmelCase__      : str			       ="google/bigbird-roberta-base"
  UpperCAmelCase__      : int			       =3_0_0_0
  UpperCAmelCase__      : int			       =1_0_5_0_0

  UpperCAmelCase__      : int			       =1_2_8
  UpperCAmelCase__      : int			       =3

  UpperCAmelCase__      : int			       =1
  UpperCAmelCase__      : int			       =5

  # tx_args
  UpperCAmelCase__      : float			       =3E-5
  UpperCAmelCase__      : float			       =0.0
  UpperCAmelCase__      : int			       =2_0_0_0_0
  UpperCAmelCase__      : float			       =0.0095

  UpperCAmelCase__      : str			       ="bigbird-roberta-natural-questions"
  UpperCAmelCase__      : str			       ="training-expt"
  UpperCAmelCase__      : str			       ="data/nq-training.jsonl"
  UpperCAmelCase__      : str			       ="data/nq-validation.jsonl"


  def  _lowercase      (			self    : Dict		)					->Union[str, Any]:
        """simple docstring"""







        os.makedirs(self.base_dir				,				exist_ok=UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Optional[int]       =   os.path.join(self.base_dir				,				self.save_dir		)
        SCREAMING_SNAKE_CASE :      List[str]       =   self.batch_size_per_device * jax.device_count()







@dataclass
class        a__       :







  """simple docstring"""




  UpperCAmelCase__      : int
  UpperCAmelCase__      : int			       =4_0_9_6  # no dynamic padding on TPUs


  def __call__(			self    : str				,				UpperCAmelCase__    : Union[str, Any]		)					->int:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      int       =   self.collate_fn(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      str       =   jax.tree_util.tree_map(UpperCAmelCase__				,				UpperCAmelCase__		)
        return batch


  def  _lowercase      (			self    : List[str]				,				UpperCAmelCase__    : List[Any]		)					->Union[str, Any]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      str       =   self.fetch_inputs(features["""input_ids"""]		)
        SCREAMING_SNAKE_CASE :      List[Any]       =   {
            """input_ids""": jnp.array(UpperCAmelCase__				,				dtype=jnp.intaa		),
            """attention_mask""": jnp.array(UpperCAmelCase__				,				dtype=jnp.intaa		),
            """start_labels""": jnp.array(features["""start_token"""]				,				dtype=jnp.intaa		),
            """end_labels""": jnp.array(features["""end_token"""]				,				dtype=jnp.intaa		),
            """pooled_labels""": jnp.array(features["""category"""]				,				dtype=jnp.intaa		),
        }
        return batch


  def  _lowercase      (			self    : int				,				UpperCAmelCase__    : list		)					->List[str]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Optional[int]       =   [self._fetch_inputs(UpperCAmelCase__		) for ids in input_ids]
        return zip(*UpperCAmelCase__		)




  def  _lowercase      (			self    : Optional[int]				,				UpperCAmelCase__    : list		)					->Optional[Any]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   [1 for _ in range(len(UpperCAmelCase__		)		)]
        while len(UpperCAmelCase__		) < self.max_length:
              input_ids.append(self.pad_id		)
              attention_mask.append(0		)
        return input_ids, attention_mask






def 					__lowercase      (     _A						,    _A						,    _A=None			)     ->						Any:
      if seed is not None:
            SCREAMING_SNAKE_CASE :      List[str]       =   dataset.shuffle(seed=_A			)
      for i in range(len(_A			) // batch_size			):
            SCREAMING_SNAKE_CASE :      Any       =   dataset[i * batch_size : (i + 1) * batch_size]
            yield dict(_A			)






@partial(jax.pmap						,    axis_name="""batch"""			)
def 					__lowercase      (     _A						,    _A						,    **_A			)     ->						str:
      def loss_fn(_A			):
            SCREAMING_SNAKE_CASE :      Tuple       =   model_inputs.pop("""start_labels"""			)
            SCREAMING_SNAKE_CASE :      Tuple       =   model_inputs.pop("""end_labels"""			)
            SCREAMING_SNAKE_CASE :      Tuple       =   model_inputs.pop("""pooled_labels"""			)

            SCREAMING_SNAKE_CASE :      Optional[Any]       =   state.apply_fn(**_A						,    params=_A						,    dropout_rng=_A						,    train=_A			)
            SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      str       =   outputs

            return state.loss_fn(
                _A						,    _A						,    _A						,    _A						,    _A						,    _A						,    )

      SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      Optional[Any]       =   jax.random.split(_A			)
      SCREAMING_SNAKE_CASE :      Tuple       =   jax.value_and_grad(_A			)
      SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      Dict       =   grad_fn(state.params			)
      SCREAMING_SNAKE_CASE :      Optional[int]       =   jax.lax.pmean({"""loss""": loss}						,    axis_name="""batch"""			)
      SCREAMING_SNAKE_CASE :      List[str]       =   jax.lax.pmean(_A						,    """batch"""			)

      SCREAMING_SNAKE_CASE :      Union[str, Any]       =   state.apply_gradients(grads=_A			)
      return state, metrics, new_drp_rng






@partial(jax.pmap						,    axis_name="""batch"""			)
def 					__lowercase      (     _A						,    **_A			)     ->						Dict:
      SCREAMING_SNAKE_CASE :      Dict       =   model_inputs.pop("""start_labels"""			)
      SCREAMING_SNAKE_CASE :      Any       =   model_inputs.pop("""end_labels"""			)
      SCREAMING_SNAKE_CASE :      str       =   model_inputs.pop("""pooled_labels"""			)

      SCREAMING_SNAKE_CASE :      List[str]       =   state.apply_fn(**_A						,    params=state.params						,    train=_A			)
      SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      Optional[int]       =   outputs

      SCREAMING_SNAKE_CASE :      Tuple       =   state.loss_fn(_A						,    _A						,    _A						,    _A						,    _A						,    _A			)
      SCREAMING_SNAKE_CASE :      List[Any]       =   jax.lax.pmean({"""loss""": loss}						,    axis_name="""batch"""			)
      return metrics







class        a__       (   train_state.TrainState       ):







  """simple docstring"""




  UpperCAmelCase__      : Callable			       =struct.field(pytree_node=UpperCAmelCase       )







@dataclass
class        a__       :







  """simple docstring"""




  UpperCAmelCase__      : Args
  UpperCAmelCase__      : Callable
  UpperCAmelCase__      : Callable
  UpperCAmelCase__      : Callable
  UpperCAmelCase__      : Callable
  UpperCAmelCase__      : wandb
  UpperCAmelCase__      : Callable			       =None


  def  _lowercase      (			self    : int				,				UpperCAmelCase__    : Any				,				UpperCAmelCase__    : Optional[int]				,				UpperCAmelCase__    : int				,				UpperCAmelCase__    : Optional[int]=None		)					->Optional[int]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   model.params
        SCREAMING_SNAKE_CASE :      List[str]       =   TrainState.create(
            apply_fn=model.__call__				,				params=UpperCAmelCase__				,				tx=UpperCAmelCase__				,				loss_fn=UpperCAmelCase__				,				)
        if ckpt_dir is not None:
              SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      str       =   restore_checkpoint(UpperCAmelCase__				,				UpperCAmelCase__		)
              SCREAMING_SNAKE_CASE :      List[str]       =   {
                  """lr""": args.lr,
                  """init_lr""": args.init_lr,
                  """warmup_steps""": args.warmup_steps,
                  """num_train_steps""": num_train_steps,
                  """weight_decay""": args.weight_decay,
              }
              SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      Any       =   build_tx(**UpperCAmelCase__		)
              SCREAMING_SNAKE_CASE :      Optional[int]       =   train_state.TrainState(
                  step=UpperCAmelCase__				,				apply_fn=model.__call__				,				params=UpperCAmelCase__				,				tx=UpperCAmelCase__				,				opt_state=UpperCAmelCase__				,				)
              SCREAMING_SNAKE_CASE :      List[str]       =   args
              SCREAMING_SNAKE_CASE :      Optional[int]       =   data_collator
              SCREAMING_SNAKE_CASE :      Dict       =   lr
              SCREAMING_SNAKE_CASE :      str       =   params
        SCREAMING_SNAKE_CASE :      int       =   jax_utils.replicate(UpperCAmelCase__		)
        return state


  def  _lowercase      (			self    : Union[str, Any]				,				UpperCAmelCase__    : List[Any]				,				UpperCAmelCase__    : List[Any]				,				UpperCAmelCase__    : List[str]		)					->Dict:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   self.args
        SCREAMING_SNAKE_CASE :      Dict       =   len(UpperCAmelCase__		) // args.batch_size

        SCREAMING_SNAKE_CASE :      str       =   jax.random.PRNGKey(0		)
        SCREAMING_SNAKE_CASE :      List[Any]       =   jax.random.split(UpperCAmelCase__				,				jax.device_count()		)
        for epoch in range(args.max_epochs		):
              SCREAMING_SNAKE_CASE :      List[Any]       =   jnp.array(0				,				dtype=jnp.floataa		)
              SCREAMING_SNAKE_CASE :      Any       =   get_batched_dataset(UpperCAmelCase__				,				args.batch_size				,				seed=UpperCAmelCase__		)
              SCREAMING_SNAKE_CASE :      int       =   0
              for batch in tqdm(UpperCAmelCase__				,				total=UpperCAmelCase__				,				desc=f"Running EPOCH-{epoch}"		):
                    SCREAMING_SNAKE_CASE :      Optional[Any]       =   self.data_collator(UpperCAmelCase__		)
                    SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE     ,	SCREAMING_SNAKE_CASE :      List[Any]       =   self.train_step_fn(UpperCAmelCase__				,				UpperCAmelCase__				,				**UpperCAmelCase__		)
                    running_loss += jax_utils.unreplicate(metrics["""loss"""]		)
                    i += 1
                    if i % args.logging_steps == 0:
                          SCREAMING_SNAKE_CASE :      Optional[int]       =   jax_utils.unreplicate(state.step		)
                          SCREAMING_SNAKE_CASE :      Dict       =   running_loss.item() / i
                          SCREAMING_SNAKE_CASE :      List[Any]       =   self.scheduler_fn(state_step - 1		)

                          SCREAMING_SNAKE_CASE :      Optional[int]       =   self.evaluate(UpperCAmelCase__				,				UpperCAmelCase__		)
                          SCREAMING_SNAKE_CASE :      Optional[int]       =   {
                              """step""": state_step.item(),
                              """eval_loss""": eval_loss.item(),
                              """tr_loss""": tr_loss,
                              """lr""": lr.item(),
                          }
                          tqdm.write(str(UpperCAmelCase__		)		)
                          self.logger.log(UpperCAmelCase__				,				commit=UpperCAmelCase__		)

                    if i % args.save_steps == 0:
                          self.save_checkpoint(args.save_dir + f"-e{epoch}-s{i}"				,				state=UpperCAmelCase__		)


  def  _lowercase      (			self    : Any				,				UpperCAmelCase__    : int				,				UpperCAmelCase__    : Tuple		)					->Tuple:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      int       =   get_batched_dataset(UpperCAmelCase__				,				self.args.batch_size		)
        SCREAMING_SNAKE_CASE :      str       =   len(UpperCAmelCase__		) // self.args.batch_size
        SCREAMING_SNAKE_CASE :      List[str]       =   jnp.array(0				,				dtype=jnp.floataa		)
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   0
        for batch in tqdm(UpperCAmelCase__				,				total=UpperCAmelCase__				,				desc="""Evaluating ... """		):
              SCREAMING_SNAKE_CASE :      str       =   self.data_collator(UpperCAmelCase__		)
              SCREAMING_SNAKE_CASE :      Dict       =   self.val_step_fn(UpperCAmelCase__				,				**UpperCAmelCase__		)
              running_loss += jax_utils.unreplicate(metrics["""loss"""]		)
              i += 1
        return running_loss / i




  def  _lowercase      (			self    : Any				,				UpperCAmelCase__    : Optional[int]				,				UpperCAmelCase__    : Union[str, Any]		)					->Dict:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      Optional[int]       =   jax_utils.unreplicate(UpperCAmelCase__		)
        print(f"SAVING CHECKPOINT IN {save_dir}"				,				end=""" ... """		)
        self.model_save_fn(UpperCAmelCase__				,				params=state.params		)
        with open(os.path.join(UpperCAmelCase__				,				"""opt_state.msgpack"""		)				,				"""wb"""		) as f:
              f.write(to_bytes(state.opt_state		)		)
        joblib.dump(self.args				,				os.path.join(UpperCAmelCase__				,				"""args.joblib"""		)		)
        joblib.dump(self.data_collator				,				os.path.join(UpperCAmelCase__				,				"""data_collator.joblib"""		)		)
        with open(os.path.join(UpperCAmelCase__				,				"""training_state.json"""		)				,				"""w"""		) as f:
              json.dump({"""step""": state.step.item()}				,				UpperCAmelCase__		)
        print("""DONE"""		)






def 					__lowercase      (     _A						,    _A			)     ->						Any:
      print(F"RESTORING CHECKPOINT FROM {save_dir}"						,    end=""" ... """			)
      with open(os.path.join(_A						,    """flax_model.msgpack"""			)						,    """rb"""			) as f:
            SCREAMING_SNAKE_CASE :      Optional[Any]       =   from_bytes(state.params						,    f.read()			)

      with open(os.path.join(_A						,    """opt_state.msgpack"""			)						,    """rb"""			) as f:
            SCREAMING_SNAKE_CASE :      List[str]       =   from_bytes(state.opt_state						,    f.read()			)

      SCREAMING_SNAKE_CASE :      Union[str, Any]       =   joblib.load(os.path.join(_A						,    """args.joblib"""			)			)
      SCREAMING_SNAKE_CASE :      str       =   joblib.load(os.path.join(_A						,    """data_collator.joblib"""			)			)

      with open(os.path.join(_A						,    """training_state.json"""			)						,    """r"""			) as f:
            SCREAMING_SNAKE_CASE :      List[Any]       =   json.load(_A			)
      SCREAMING_SNAKE_CASE :      Any       =   training_state["""step"""]

      print("""DONE"""			)
      return params, opt_state, step, args, data_collator






def 					__lowercase      (     _A						,    _A						,    _A						,    _A			)     ->						Optional[int]:
      SCREAMING_SNAKE_CASE :      Optional[Any]       =   num_train_steps - warmup_steps
      SCREAMING_SNAKE_CASE :      Optional[Any]       =   optax.linear_schedule(init_value=_A						,    end_value=_A						,    transition_steps=_A			)
      SCREAMING_SNAKE_CASE :      Optional[Any]       =   optax.linear_schedule(init_value=_A						,    end_value=1e-7						,    transition_steps=_A			)
      SCREAMING_SNAKE_CASE :      str       =   optax.join_schedules(schedules=[warmup_fn, decay_fn]						,    boundaries=[warmup_steps]			)
      return lr







def 					__lowercase      (     _A						,    _A						,    _A						,    _A						,    _A			)     ->						List[Any]:
      def weight_decay_mask(_A			):
            SCREAMING_SNAKE_CASE :      List[Any]       =   traverse_util.flatten_dict(_A			)
            SCREAMING_SNAKE_CASE :      Dict       =   {k: (v[-1] != """bias""" and v[-2:] != ("""LayerNorm""", """scale""")) for k, v in params.items()}
            return traverse_util.unflatten_dict(_A			)

      SCREAMING_SNAKE_CASE :      Union[str, Any]       =   scheduler_fn(_A						,    _A						,    _A						,    _A			)

      SCREAMING_SNAKE_CASE :      Optional[int]       =   optax.adamw(learning_rate=_A						,    weight_decay=_A						,    mask=_A			)
      return tx, lr







from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase__ :     List[Any]				    =    logging.get_logger(__name__)

UpperCAmelCase__ :     int				    =    {
    """unc-nlp/lxmert-base-uncased""": """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json""",
}







class        a__       (   UpperCAmelCase       ):







  """simple docstring"""




  UpperCAmelCase__      : List[str]			       ="""lxmert"""
  UpperCAmelCase__      : str			       ={}


  def __init__(			self    : int				,				UpperCAmelCase__    : Dict=3_0_5_2_2				,				UpperCAmelCase__    : int=7_6_8				,				UpperCAmelCase__    : Union[str, Any]=1_2				,				UpperCAmelCase__    : int=9_5_0_0				,				UpperCAmelCase__    : Union[str, Any]=1_6_0_0				,				UpperCAmelCase__    : Optional[Any]=4_0_0				,				UpperCAmelCase__    : List[str]=3_0_7_2				,				UpperCAmelCase__    : List[Any]="gelu"				,				UpperCAmelCase__    : int=0.1				,				UpperCAmelCase__    : Optional[Any]=0.1				,				UpperCAmelCase__    : Union[str, Any]=5_1_2				,				UpperCAmelCase__    : int=2				,				UpperCAmelCase__    : List[str]=0.02				,				UpperCAmelCase__    : str=1e-12				,				UpperCAmelCase__    : int=9				,				UpperCAmelCase__    : Optional[int]=5				,				UpperCAmelCase__    : int=5				,				UpperCAmelCase__    : List[str]=2_0_4_8				,				UpperCAmelCase__    : Tuple=4				,				UpperCAmelCase__    : List[str]=6.67				,				UpperCAmelCase__    : Optional[int]=True				,				UpperCAmelCase__    : Dict=True				,				UpperCAmelCase__    : Optional[Any]=True				,				UpperCAmelCase__    : Optional[int]=True				,				UpperCAmelCase__    : List[Any]=True				,				UpperCAmelCase__    : Dict=True				,				UpperCAmelCase__    : Optional[Any]=True				,				**UpperCAmelCase__    : Tuple				,				)					->Optional[Any]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE :      List[str]       =   vocab_size
        SCREAMING_SNAKE_CASE :      List[Any]       =   hidden_size
        SCREAMING_SNAKE_CASE :      Any       =   num_attention_heads
        SCREAMING_SNAKE_CASE :      str       =   hidden_act
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   intermediate_size
        SCREAMING_SNAKE_CASE :      List[str]       =   hidden_dropout_prob
        SCREAMING_SNAKE_CASE :      str       =   attention_probs_dropout_prob
        SCREAMING_SNAKE_CASE :      Dict       =   max_position_embeddings
        SCREAMING_SNAKE_CASE :      Any       =   type_vocab_size
        SCREAMING_SNAKE_CASE :      Optional[int]       =   initializer_range
        SCREAMING_SNAKE_CASE :      Optional[int]       =   layer_norm_eps
        SCREAMING_SNAKE_CASE :      Dict       =   num_qa_labels
        SCREAMING_SNAKE_CASE :      str       =   num_object_labels
        SCREAMING_SNAKE_CASE :      str       =   num_attr_labels
        SCREAMING_SNAKE_CASE :      List[str]       =   l_layers
        SCREAMING_SNAKE_CASE :      Optional[int]       =   x_layers
        SCREAMING_SNAKE_CASE :      List[str]       =   r_layers
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   visual_feat_dim
        SCREAMING_SNAKE_CASE :      Dict       =   visual_pos_dim
        SCREAMING_SNAKE_CASE :      List[Any]       =   visual_loss_normalizer
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   task_matched
        SCREAMING_SNAKE_CASE :      int       =   task_mask_lm
        SCREAMING_SNAKE_CASE :      int       =   task_obj_predict
        SCREAMING_SNAKE_CASE :      Optional[int]       =   task_qa
        SCREAMING_SNAKE_CASE :      Any       =   visual_obj_loss
        SCREAMING_SNAKE_CASE :      str       =   visual_attr_loss
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   visual_feat_loss
        SCREAMING_SNAKE_CASE :      List[Any]       =   {"""vision""": r_layers, """cross_encoder""": x_layers, """language""": l_layers}
        super().__init__(**UpperCAmelCase__		)




