

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


SCREAMING_SNAKE_CASE_        =      logging.get_logger(__name__)

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

class 				a  (	UpperCAmelCase				):
						_lowercase    						=			"lxmert"
						_lowercase    						=			{}


						def __init__(       self						,					A_=30522						,					A_=768						,					A_=12						,					A_=9500						,					A_=1600						,					A_=400						,					A_=3072						,					A_="gelu"						,					A_=0.1						,					A_=0.1						,					A_=512						,					A_=2						,					A_=0.02						,					A_=1e-12						,					A_=9						,					A_=5						,					A_=5						,					A_=2048						,					A_=4						,					A_=6.67						,					A_=True						,					A_=True						,					A_=True						,					A_=True						,					A_=True						,					A_=True						,					A_=True						,					**A_						,					):







										'''simple docstring'''


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





import logging
import os

from .state import PartialState

class 				a  (	logging.LoggerAdapter				):


						@staticmethod
						def        _UpperCAmelCase				(       A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Tuple 		=    PartialState()
										return not main_process_only or (main_process_only and state.is_main_process)





						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					*A_						,					**A_	):







										'''simple docstring'''


										if PartialState._shared_state == {}:
														raise RuntimeError(
														    "You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility."	)
										_UpperCAmelCase       :		Tuple 		=    kwargs.pop("main_process_only"						,					A_	)
										_UpperCAmelCase       :		int 		=    kwargs.pop("in_order"						,					A_	)

										if self.isEnabledFor(A_	):
														if self._should_log(A_	):
																		_UpperCAmelCase		,							_UpperCAmelCase       :		Optional[int] 		=    self.process(A_						,					A_	)
																		self.logger.log(A_						,					A_						,					*A_						,					**A_	)

														elif in_order:
																		_UpperCAmelCase       :		Dict 		=    PartialState()
																		for i in range(state.num_processes	):
																						if i == state.process_index:
																										_UpperCAmelCase		,							_UpperCAmelCase       :		Union[str, Any] 		=    self.process(A_						,					A_	)
																										self.logger.log(A_						,					A_						,					*A_						,					**A_	)
																						state.wait_for_everyone()







def 							__SCREAMING_SNAKE_CASE							(				lowerCAmelCase:  str  ,      lowerCAmelCase:  str = None )   ->       List[Any]:
				if log_level is None:
								_UpperCAmelCase       :		List[str] 		=    os.environ.get("ACCELERATE_LOG_LEVEL"  ,      lowerCAmelCase )
				_UpperCAmelCase       :		str 		=    logging.getLogger(lowerCAmelCase )
				if log_level is not None:
								logger.setLevel(log_level.upper() )
								logger.root.setLevel(log_level.upper() )
				return MultiProcessAdapter(lowerCAmelCase  ,      {} )


