code: 
  
  
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  
  
  UpperCamelCase__				       =			logging.get_logger(__name__)
  
  UpperCamelCase__				       =			{
      'ZinengTang/tvlt-base': 'https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json',
  }
  
  class 					UpperCAmelCase__   (      A_		):
  
  
  
       '''simple docstring'''
       UpperCAmelCase_         =  '''tvlt'''
  
  
  
  
       def __init__( self       :       str	,      UpperCamelCase       :       str=2_24	,      UpperCamelCase       :       Any=20_48	,      UpperCamelCase       :       Optional[Any]=1_28	,      UpperCamelCase       :       List[str]=[16, 16]	,      UpperCamelCase       :       Optional[Any]=[16, 16]	,      UpperCamelCase       :       Any=3	,      UpperCamelCase       :       List[str]=1	,      UpperCamelCase       :       List[Any]=8	,      UpperCamelCase       :       List[str]=7_68	,      UpperCamelCase       :       Optional[Any]=12	,      UpperCamelCase       :       List[Any]=12	,      UpperCamelCase       :       Dict=30_72	,      UpperCamelCase       :       int="gelu"	,      UpperCamelCase       :       List[Any]=0.0	,      UpperCamelCase       :       Union[str, Any]=0.0	,      UpperCamelCase       :       Union[str, Any]=0.02	,      UpperCamelCase       :       Dict=1E-6	,      UpperCamelCase       :       Tuple=True	,      UpperCamelCase       :       Any=False	,      UpperCamelCase       :       int=16	,      UpperCamelCase       :       Optional[int]=5_12	,      UpperCamelCase       :       Optional[Any]=8	,      UpperCamelCase       :       int=20_48	,      UpperCamelCase       :       Optional[Any]=0.75	,      UpperCamelCase       :       List[str]=0.15	,      UpperCamelCase       :       int="frame-level"	,      UpperCamelCase       :       List[str]=True	,      UpperCamelCase       :       List[Any]=True	,      UpperCamelCase       :       Any="classification"	,      **UpperCamelCase       :       Dict	,      ):
  
  
  
  
  
              """simple docstring"""
  
  
  
              super().__init__(**__lowerCamelCase		)
  
              if audio_mask_type not in ("frame-level", "patch_level"):
                     raise ValueError(
                         '''audio_mask_type must be one of two acceptable strategies - {\'frame_level\', \'patch-level\') '''
                         F'got {audio_mask_type}'		)
  
              _lowercase					:				int           =			image_size
              _lowercase					:				List[str]           =			spectrogram_length
              _lowercase					:				Any           =			frequency_length
              _lowercase					:				Optional[Any]           =			image_patch_size
              _lowercase					:				Tuple           =			audio_patch_size
              _lowercase					:				List[Any]           =			num_image_channels
              _lowercase					:				List[str]           =			num_audio_channels
              _lowercase					:				Optional[Any]           =			num_frames
  
              _lowercase					:				Optional[int]           =			hidden_size
              _lowercase					:				Any           =			num_hidden_layers
              _lowercase					:				Dict           =			num_attention_heads
              _lowercase					:				str           =			intermediate_size
              _lowercase					:				Optional[int]           =			hidden_act
              _lowercase					:				Tuple           =			hidden_dropout_prob
              _lowercase					:				Union[str, Any]           =			attention_probs_dropout_prob
              _lowercase					:				Optional[Any]           =			initializer_range
              _lowercase					:				Tuple           =			layer_norm_eps
              _lowercase					:				Optional[Any]           =			qkv_bias
              _lowercase					:				List[Any]           =			use_mean_pooling
  
              _lowercase					:				Dict           =			decoder_num_attention_heads
              _lowercase					:				Union[str, Any]           =			decoder_hidden_size
              _lowercase					:				Dict           =			decoder_num_hidden_layers
              _lowercase					:				Tuple           =			decoder_intermediate_size
              _lowercase					:				Dict           =			pixel_mask_ratio
              _lowercase					:				Union[str, Any]           =			audio_mask_ratio
              _lowercase					:				List[str]           =			audio_mask_type
  
              _lowercase					:				List[Any]           =			task_matching
              _lowercase					:				Union[str, Any]           =			task_mae
              _lowercase					:				Optional[Any]           =			loss_type
style_context: 
  
  
  # limitations under the License.
  
  
  from typing import Optional, Tuple, Union
  
  import torch
  
  from diffusers.pipeline_utils import DiffusionPipeline, ImagePipelineOutput
  
  class 						UpperCAmelCase__   (      A_		):
  
  
  
       '''simple docstring'''
  
  
  
  
       def __init__( self       :       List[str]	,      UpperCamelCase       :       Union[str, Any]	,      UpperCamelCase       :       int		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              super().__init__()
              self.register_modules(unet=UpperCamelCase	,      scheduler=UpperCamelCase		)
  
  
  
  
       @torch.no_grad()
       def __call__( self       :       Any	,      UpperCamelCase       :       int = 1	,      UpperCamelCase       :       Optional[torch.Generator] = None	,      UpperCamelCase       :       int = 50	,      UpperCamelCase       :       Optional[str] = "pil"	,      UpperCamelCase       :       bool = True	,      **UpperCamelCase       :       int	,      ):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				Optional[int]           =			torch.randn(
                  (batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)	,      generator=UpperCamelCase	,      )
              _lowercase					:				Dict           =			image.to(self.device		)
  
              # set step values
              self.scheduler.set_timesteps(UpperCamelCase		)
  
              for t in self.progress_bar(self.scheduler.timesteps		):
                     # 1. predict noise model_output
                     _lowercase					:				Dict           =			self.unet(UpperCamelCase	,      UpperCamelCase		).sample
  
                     # 2. predict previous mean of image x_t-1 and add variance depending on eta
                     # eta corresponds to η in paper and should be between [0, 1]
                     # do x_t -> x_t-1
                     _lowercase					:				Tuple           =			self.scheduler.step(UpperCamelCase	,      UpperCamelCase	,      UpperCamelCase		).prev_sample
  
              _lowercase					:				Optional[int]           =			(image / 2 + 0.5).clamp(0	,      1		)
              _lowercase					:				int           =			image.cpu().permute(0	,      2	,      3	,      1		).numpy()
              if output_type == "pil":
                     _lowercase					:				List[Any]           =			self.numpy_to_pil(UpperCamelCase		)
  
              if not return_dict:
                     return (image,), "This is a local test"
  
              return ImagePipelineOutput(images=UpperCamelCase		), "This is a local test"