






"""simple docstring"""
import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel



class   SCREAMING_SNAKE_CASE	(					_SCREAMING_SNAKE_CASE    ):





	"""simple docstring"""




	_A							:					List[str] 			=					"""M-CLIP"""





	def __init__(self  ,  lowerCAmelCase_=1024  ,  lowerCAmelCase_=768  ,  **lowerCAmelCase_				):
		A_		:    int						     = transformerDimSize
		A_		:    int						     = imageDimSize
		super().__init__(**lowerCAmelCase_				)






class   SCREAMING_SNAKE_CASE	(					_SCREAMING_SNAKE_CASE    ):





	"""simple docstring"""




	_A							:					str 			=					MCLIPConfig





	def __init__(self  ,  lowerCAmelCase_  ,  *lowerCAmelCase_  ,  **lowerCAmelCase_				):
		super().__init__(lowerCAmelCase_  ,  *lowerCAmelCase_  ,  **lowerCAmelCase_				)
		A_		:    Union[str, Any]						     = XLMRobertaModel(lowerCAmelCase_				)
		A_		:    List[Any]						     = torch.nn.Linear(
		    in_features=config.transformerDimensions  ,  out_features=config.numDims				)





	def  lowerCamelCase(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_				):
		A_		:    Any						     = self.transformer(input_ids=lowerCAmelCase_  ,  attention_mask=lowerCAmelCase_				)[0]
		A_		:    Union[str, Any]						     = (embs * attention_mask.unsqueeze(2				)).sum(dim=1				) / attention_mask.sum(dim=1				)[:, None]
		return self.LinearTransformation(lowerCAmelCase_				), embs









"""simple docstring"""
from __future__ import annotations






def       __UpperCamelCase						(		snake_case__ , snake_case__       ):
	if len(snake_case__       ) == 0:
		return False
	A_		:    Union[str, Any]						     = len(snake_case__       ) // 2
	if a_list[midpoint] == item:
		return True
	if item < a_list[midpoint]:
		return binary_search(a_list[:midpoint] , snake_case__       )
	else:
		return binary_search(a_list[midpoint + 1 :] , snake_case__       )


if __name__ == "__main__":
							_lowerCAmelCase       =				input("Enter numbers separated by comma:\n").strip()
							_lowerCAmelCase       =				[int(item.strip()) for item in user_input.split(",")]
							_lowerCAmelCase       =				int(input("Enter the number to be found in the list:\n").strip())
							_lowerCAmelCase       =				"" if binary_search(sequence, target) else "not "
							print(F'{target} was {not_str}found in {sequence}')

