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


lowercase						:      List[Any]									= logging.get_logger(__name__)

lowercase						:      Tuple									= {
    'facebook/timesformer': 'https://huggingface.co/facebook/timesformer/resolve/main/config.json',
}




class 				lowerCamelCase__							(       __lowercase):




	'''simple docstring'''




	_A			=  'timesformer'







	def __init__(      self	:Union[str, Any]  ,     a	:int=2_2_4  ,     a	:str=1_6  ,     a	:List[str]=3  ,     a	:str=8  ,     a	:Any=7_6_8  ,     a	:int=1_2  ,     a	:Tuple=1_2  ,     a	:Optional[Any]=3_0_7_2  ,     a	:Any="gelu"  ,     a	:Optional[Any]=0.0  ,     a	:Union[str, Any]=0.0  ,     a	:int=0.02  ,     a	:str=1E-6  ,     a	:Any=True  ,     a	:str="divided_space_time"  ,     a	:Dict=0  ,     **a	:List[Any]  ,     )	->				List[Any]:
								super().__init__(**a		)

								__UpperCamelCase			:     Any         =      image_size
								__UpperCamelCase			:     Union[str, Any]         =      patch_size
								__UpperCamelCase			:     Union[str, Any]         =      num_channels
								__UpperCamelCase			:     Union[str, Any]         =      num_frames

								__UpperCamelCase			:     int         =      hidden_size
								__UpperCamelCase			:     List[str]         =      num_hidden_layers
								__UpperCamelCase			:     List[Any]         =      num_attention_heads
								__UpperCamelCase			:     Optional[int]         =      intermediate_size
								__UpperCamelCase			:     Optional[Any]         =      hidden_act
								__UpperCamelCase			:     Any         =      hidden_dropout_prob
								__UpperCamelCase			:     Optional[int]         =      attention_probs_dropout_prob
								__UpperCamelCase			:     Dict         =      initializer_range
								__UpperCamelCase			:     Dict         =      layer_norm_eps
								__UpperCamelCase			:     Dict         =      qkv_bias

								__UpperCamelCase			:     Tuple         =      attention_type
								__UpperCamelCase			:     Optional[Any]         =      drop_path_rate

import argparse

from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection

from diffusers import UnCLIPImageVariationPipeline, UnCLIPPipeline


if __name__ == "__main__":
		lowercase						:      List[str]									= argparse.ArgumentParser()

		parser.add_argument('--dump_path', default=None, type=str, required=True, help='Path to the output model.')

		parser.add_argument(
		    '--txt2img_unclip',
		    default='kakaobrain/karlo-v1-alpha',
		    type=str,
		    required=False,
		    help='The pretrained txt2img unclip.',
		)

		lowercase						:      int									= parser.parse_args()

		lowercase						:      str									= UnCLIPPipeline.from_pretrained(args.txtaimg_unclip)

		lowercase						:      int									= CLIPImageProcessor()
		lowercase						:      Optional[int]									= CLIPVisionModelWithProjection.from_pretrained('openai/clip-vit-large-patch14')

		lowercase						:      int									= UnCLIPImageVariationPipeline(
		    decoder=txtaimg.decoder,
		    text_encoder=txtaimg.text_encoder,
		    tokenizer=txtaimg.tokenizer,
		    text_proj=txtaimg.text_proj,
		    feature_extractor=feature_extractor,
		    image_encoder=image_encoder,
		    super_res_first=txtaimg.super_res_first,
		    super_res_last=txtaimg.super_res_last,
		    decoder_scheduler=txtaimg.decoder_scheduler,
		    super_res_scheduler=txtaimg.super_res_scheduler,
		)

		imgaimg.save_pretrained(args.dump_path)