


'''simple docstring'''



import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel





class 							__UpperCamelCase    (		snake_case_ ):
	A_           =   "M-CLIP"




	def __init__(       self						,    __a=1024						,    __a=768						,    **__a							):

						'''simple docstring'''





						__a      :	Tuple    =  transformerDimSize
						__a      :	Optional[Any]    =  imageDimSize
						super().__init__(**__a							)





class 							__UpperCamelCase    (		snake_case_ ):
	A_           =   MCLIPConfig




	def __init__(       self						,    __a						,    *__a						,    **__a							):

						'''simple docstring'''





						super().__init__(__a						,    *__a						,    **__a							)
						__a      :	Optional[int]    =  XLMRobertaModel(__a							)
						__a      :	List[str]    =  torch.nn.Linear(
						    in_features=config.transformerDimensions						,    out_features=config.numDims							)





	def 				__UpperCAmelCase							(       self						,    __a						,    __a							):

						'''simple docstring'''





						__a      :	List[Any]    =  self.transformer(input_ids=__a						,    attention_mask=__a							)[0]
						__a      :	Optional[Any]    =  (embs * attention_mask.unsqueeze(2							)).sum(dim=1							) / attention_mask.sum(dim=1							)[:, None]
						return self.LinearTransformation(__a							), embs







'''simple docstring'''



import os






def   lowerCamelCase							():
					with open(os.path.dirname(_SCREAMING_SNAKE_CASE       ) + '/p022_names.txt'       ) as file:
										__a      :	List[Any]    =  str(file.readlines()[0]       )
										__a      :	str    =  names.replace('"'						,				''       ).split(','       )

					names.sort()

					__a      :	Union[str, Any]    =  0
					__a      :	Tuple    =  0

					for i, name in enumerate(_SCREAMING_SNAKE_CASE       ):
										for letter in name:
															name_score += ord(_SCREAMING_SNAKE_CASE       ) - 64

										total_score += (i + 1) * name_score
										__a      :	Any    =  0
					return total_score


if __name__ == "__main__":
	print(solution())



