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


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

lowerCamelCase_    :		Optional[int]							=	{
    """alibaba-damo/mgp-str-base""": """https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json""",
}


class 						a__							(       __snake_case		):
			A__    :       Tuple        =      'mgp-str'



			def __init__(						self				,						UpperCAmelCase=[3_2, 1_2_8]				,						UpperCAmelCase=4				,						UpperCAmelCase=3				,						UpperCAmelCase=2_7				,						UpperCAmelCase=3_8				,						UpperCAmelCase=5_0_2_5_7				,						UpperCAmelCase=3_0_5_2_2				,						UpperCAmelCase=7_6_8				,						UpperCAmelCase=1_2				,						UpperCAmelCase=1_2				,						UpperCAmelCase=4.0				,						UpperCAmelCase=True				,						UpperCAmelCase=False				,						UpperCAmelCase=1e-5				,						UpperCAmelCase=0.0				,						UpperCAmelCase=0.0				,						UpperCAmelCase=0.0				,						UpperCAmelCase=False				,						UpperCAmelCase=0.02				,						**UpperCAmelCase				,						)			->   Optional[int]:
								super().__init__(**UpperCAmelCase   )

								__a		 =       image_size
								__a		 =       patch_size
								__a		 =       num_channels
								__a		 =       max_token_length
								__a		 =       num_character_labels
								__a		 =       num_bpe_labels
								__a		 =       num_wordpiece_labels
								__a		 =       hidden_size
								__a		 =       num_hidden_layers
								__a		 =       num_attention_heads
								__a		 =       mlp_ratio
								__a		 =       distilled
								__a		 =       layer_norm_eps
								__a		 =       drop_rate
								__a		 =       qkv_bias
								__a		 =       attn_drop_rate
								__a		 =       drop_path_rate
								__a		 =       output_aa_attentions
								__a		 =       initializer_range





from datetime import datetime

import matplotlib.pyplot as plt
import torch
def 							lowerCAmelCase(     __lowerCamelCase						):
					for param in module.parameters():
										__a		 =       False
def 							lowerCAmelCase(     ):
					__a		 =       'cuda' if torch.cuda.is_available() else 'cpu'
					if torch.backends.mps.is_available() and torch.backends.mps.is_built():
										__a		 =       'mps'
					if device == "mps":
										print(
										    'WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'
										    ' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'
										    ' with generations.'						)
					return device
def 							lowerCAmelCase(     __lowerCamelCase						):
					__a		 =       plt.imshow(__lowerCamelCase						)
					fig.axes.get_xaxis().set_visible(__lowerCamelCase						)
					fig.axes.get_yaxis().set_visible(__lowerCamelCase						)
					plt.show()



def 							lowerCAmelCase(     ):
					__a		 =       datetime.now()
					__a		 =       current_time.strftime('%H:%M:%S'						)
					return timestamp




