


'''simple docstring'''
import warnings

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


__snake_case							      =     logging.get_logger(__name__)

__snake_case							      =     {
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}
class    lowercase	(							A__					):

		"""simple docstring"""

		_a     =				'xlnet'
		_a     =				['mems']
		_a     =				{
		    'n_token': 'vocab_size',  # Backward compatibility
		    'hidden_size': 'd_model',
		    'num_attention_heads': 'n_head',
		    'num_hidden_layers': 'n_layer',
		}




		def __init__(		self    ,   UpperCamelCase_=32000    ,   UpperCamelCase_=1024    ,   UpperCamelCase_=24    ,   UpperCamelCase_=16    ,   UpperCamelCase_=4096    ,   UpperCamelCase_="gelu"    ,   UpperCamelCase_=True    ,   UpperCamelCase_="bi"    ,   UpperCamelCase_=0.02    ,   UpperCamelCase_=1e-12    ,   UpperCamelCase_=0.1    ,   UpperCamelCase_=512    ,   UpperCamelCase_=None    ,   UpperCamelCase_=True    ,   UpperCamelCase_=False    ,   UpperCamelCase_=False    ,   UpperCamelCase_=-1    ,   UpperCamelCase_=False    ,   UpperCamelCase_="last"    ,   UpperCamelCase_=True    ,   UpperCamelCase_="tanh"    ,   UpperCamelCase_=0.1    ,   UpperCamelCase_=5    ,   UpperCamelCase_=5    ,   UpperCamelCase_=5    ,   UpperCamelCase_=1    ,   UpperCamelCase_=2    ,   **UpperCamelCase_    ,   ):

							'''simple docstring'''


							UpperCamelCase__   :Union[str, Any]												= vocab_size
							UpperCamelCase__   :List[str]												= d_model
							UpperCamelCase__   :Dict												= n_layer
							UpperCamelCase__   :Any												= n_head
							if d_model % n_head != 0:
												raise ValueError(F'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''							)
							if "d_head" in kwargs:
												if kwargs["d_head"] != d_model // n_head:
																	raise ValueError(
																	    F'''`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})'''							)
							UpperCamelCase__   :List[Any]												= d_model // n_head
							UpperCamelCase__   :str												= ff_activation
							UpperCamelCase__   :Optional[int]												= d_inner
							UpperCamelCase__   :int												= untie_r
							UpperCamelCase__   :Optional[int]												= attn_type

							UpperCamelCase__   :Optional[int]												= initializer_range
							UpperCamelCase__   :Optional[int]												= layer_norm_eps

							UpperCamelCase__   :Tuple												= dropout
							UpperCamelCase__   :Union[str, Any]												= mem_len
							UpperCamelCase__   :Optional[int]												= reuse_len
							UpperCamelCase__   :Optional[Any]												= bi_data
							UpperCamelCase__   :Optional[Any]												= clamp_len
							UpperCamelCase__   :Optional[Any]												= same_length

							UpperCamelCase__   :List[str]												= summary_type
							UpperCamelCase__   :Optional[Any]												= summary_use_proj
							UpperCamelCase__   :Optional[Any]												= summary_activation
							UpperCamelCase__   :int												= summary_last_dropout
							UpperCamelCase__   :Dict												= start_n_top
							UpperCamelCase__   :Union[str, Any]												= end_n_top

							UpperCamelCase__   :Any												= bos_token_id
							UpperCamelCase__   :int												= pad_token_id
							UpperCamelCase__   :Optional[int]												= eos_token_id

							if "use_cache" in kwargs:
												warnings.warn(
												    '''The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'''
												    ''' instead.'''    ,   UpperCamelCase_    ,   )
												UpperCamelCase__   :Optional[Any]												= kwargs['''use_cache''']

							UpperCamelCase__   :List[Any]												= use_mems_eval
							UpperCamelCase__   :Any												= use_mems_train
							super().__init__(pad_token_id=UpperCamelCase_    ,   bos_token_id=UpperCamelCase_    ,   eos_token_id=UpperCamelCase_    ,   **UpperCamelCase_							)




		@property
		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


							logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''							)
							return -1




		@max_position_embeddings.setter
		def     lowerCAmelCase__				(		self    ,   UpperCamelCase_							):

							'''simple docstring'''


							raise NotImplementedError(
							    F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''							)



'''simple docstring'''
from ...utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_torch_available,
    is_transformers_available,
)


try:
		if not (is_transformers_available() and is_torch_available()):
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
		from .multicontrolnet import MultiControlNetModel
		from .pipeline_controlnet import StableDiffusionControlNetPipeline
		from .pipeline_controlnet_imgaimg import StableDiffusionControlNetImgaImgPipeline
		from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline


if is_transformers_available() and is_flax_available():
		from .pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline