


'''simple docstring'''


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


UpperCAmelCase_		:   Union[str, Any]							   =		logging.get_logger(__name__)

UpperCAmelCase_		:   Dict							   =		{"""ctrl""": """https://huggingface.co/ctrl/resolve/main/config.json"""}





class     lowercase__  (						lowercase_					):





							'''simple docstring'''


							A_							:      str      	=  '''ctrl'''
							A_							:      Optional[Any]      	=  ['''past_key_values''']
							A_							:      Optional[Any]      	=  {
							    '''max_position_embeddings''': '''n_positions''',
							    '''hidden_size''': '''n_embd''',
							    '''num_attention_heads''': '''n_head''',
							    '''num_hidden_layers''': '''n_layer''',
							}






							def __init__(    self    ,					__snake_case=24_6534    ,					__snake_case=256    ,					__snake_case=1280    ,					__snake_case=8192    ,					__snake_case=48    ,					__snake_case=16    ,					__snake_case=0.1    ,					__snake_case=0.1    ,					__snake_case=1e-6    ,					__snake_case=0.02    ,					__snake_case=True    ,					**__snake_case    ,					):
											_SCREAMING_SNAKE_CASE :       str     		=      vocab_size
											_SCREAMING_SNAKE_CASE :       Union[str, Any]     		=      n_positions
											_SCREAMING_SNAKE_CASE :       Optional[int]     		=      n_embd
											_SCREAMING_SNAKE_CASE :       str     		=      n_layer
											_SCREAMING_SNAKE_CASE :       Optional[int]     		=      n_head
											_SCREAMING_SNAKE_CASE :       int     		=      dff
											_SCREAMING_SNAKE_CASE :       Tuple     		=      resid_pdrop
											_SCREAMING_SNAKE_CASE :       Tuple     		=      embd_pdrop
											_SCREAMING_SNAKE_CASE :       Any     		=      layer_norm_epsilon
											_SCREAMING_SNAKE_CASE :       Tuple     		=      initializer_range

											_SCREAMING_SNAKE_CASE :       str     		=      use_cache

											super().__init__(**__snake_case  )







from PIL import Image





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






							snake_case_							=    (259 * (level + 255)) / (255 * (259 - level))

							def contrast(UpperCamelCase__      ) -> int:
														return int(128 + factor * (c - 128)      )

							return img.point(UpperCamelCase__      )


if __name__ == "__main__":
					# Load image
					with Image.open("""image_data/lena.jpg""") as img:
										# Change contrast to 170
										_UpperCAmelCase		:   Tuple										=       change_contrast(img, 170)
										cont_img.save("""image_data/lena_high_contrast.png""", format="""png""")




