

from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import BaseOutput, is_torch_available, is_transformers_available






@dataclass
class     lowerCamelCase_			(  _lowercase  ):
	_lowercase		:      Optional[int]    				=							{
	    '''sld_warmup_steps''': 15,
	    '''sld_guidance_scale''': 20,
	    '''sld_threshold''': 0.0,
	    '''sld_momentum_scale''': 0.0,
	    '''sld_mom_beta''': 0.0,
	}
	_lowercase		:      List[Any]    				=							{
	    '''sld_warmup_steps''': 10,
	    '''sld_guidance_scale''': 1000,
	    '''sld_threshold''': 0.01,
	    '''sld_momentum_scale''': 0.3,
	    '''sld_mom_beta''': 0.4,
	}
	_lowercase		:      List[Any]    				=							{
	    '''sld_warmup_steps''': 7,
	    '''sld_guidance_scale''': 2000,
	    '''sld_threshold''': 0.0_25,
	    '''sld_momentum_scale''': 0.5,
	    '''sld_mom_beta''': 0.7,
	}
	_lowercase		:      Dict    				=							{
	    '''sld_warmup_steps''': 0,
	    '''sld_guidance_scale''': 5000,
	    '''sld_threshold''': 1.0,
	    '''sld_momentum_scale''': 0.5,
	    '''sld_mom_beta''': 0.7,
	}






@dataclass
class     lowerCamelCase_			(  _lowercase  ):
	_lowercase		:      Union[List[PIL.Image.Image], np.ndarray]
	_lowercase		:      Optional[List[bool]]
	_lowercase		:      Optional[Union[List[PIL.Image.Image], np.ndarray]]
	_lowercase		:      Optional[str]


if is_transformers_available() and is_torch_available():
			from .pipeline_stable_diffusion_safe import StableDiffusionPipelineSafe
			from .safety_checker import SafeStableDiffusionSafetyChecker








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


UpperCAmelCase_       :				Optional[Any]		   =      logging.get_logger(__name__)

UpperCAmelCase_       :				List[str]		   =      {
    '''uw-madison/nystromformer-512''': '''https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json''',
    # See all Nystromformer models at https://huggingface.co/models?filter=nystromformer
}






class     lowerCamelCase_			(  _lowercase  ):
	_lowercase		:      Optional[Any]    				=							'''nystromformer'''




	def __init__(    self	:    Optional[Any]				,			__A	:    Optional[Any]=3_0000				,			__A	:    Optional[int]=768				,			__A	:    List[str]=12				,			__A	:    str=12				,			__A	:    Tuple=3072				,			__A	:    List[Any]="gelu_new"				,			__A	:    Dict=0.1				,			__A	:    Optional[int]=0.1				,			__A	:    int=510				,			__A	:    Union[str, Any]=2				,			__A	:    Optional[int]=64				,			__A	:    str=64				,			__A	:    List[str]=65				,			__A	:    Tuple=False				,			__A	:    List[str]=0.0_2				,			__A	:    Tuple=1e-5				,			__A	:    List[str]=1				,			__A	:    int=0				,			__A	:    Tuple=2				,			**__A	:    Dict				,			):
		__A   : str								= vocab_size
		__A   : Union[str, Any]								= max_position_embeddings
		__A   : Optional[int]								= hidden_size
		__A   : Optional[int]								= num_hidden_layers
		__A   : List[Any]								= num_attention_heads
		__A   : Dict								= intermediate_size
		__A   : Union[str, Any]								= hidden_act
		__A   : int								= hidden_dropout_prob
		__A   : Tuple								= attention_probs_dropout_prob
		__A   : Optional[Any]								= initializer_range
		__A   : int								= type_vocab_size
		__A   : Optional[int]								= segment_means_seq_len
		__A   : List[str]								= num_landmarks
		__A   : Dict								= conv_kernel_size
		__A   : Union[str, Any]								= inv_coeff_init_option
		__A   : Union[str, Any]								= layer_norm_eps
		super().__init__(pad_token_id=__A				,			bos_token_id=__A				,			eos_token_id=__A				,			**__A       )





