




'''simple docstring'''

from typing import Dict

from .base import GenericTensor, Pipeline



class 		SCREAMING_SNAKE_CASE__  (			_UpperCamelCase	):





			def 							A (      self						:    Dict      ,		a_						:    str=None      ,		a_						:    Any=None      ,		a_						:    Optional[Any]=None      ,		**a_						:    str							):



						"""simple docstring"""




						if tokenize_kwargs is None:
									__snake_case			=		{}

						if truncation is not None:
									if "truncation" in tokenize_kwargs:
												raise ValueError(
												    "truncation parameter defined twice (given as keyword argument as well as in tokenize_kwargs)"							)
									__snake_case			=		truncation

						__snake_case			=		tokenize_kwargs

						__snake_case			=		{}
						if return_tensors is not None:
									__snake_case			=		return_tensors

						return preprocess_params, {}, postprocess_params





			def 							A (      self						:    str      ,		a_						:    Optional[int]      ,		**a_						:    Tuple							):



						"""simple docstring"""




						__snake_case			=		self.framework
						__snake_case			=		self.tokenizer(a_      ,		return_tensors=a_      ,		**a_							)
						return model_inputs





			def 							A (      self						:    int      ,		a_						:    Any							):



						"""simple docstring"""




						__snake_case			=		self.model(**a_							)
						return model_outputs





			def 							A (      self						:    Dict      ,		a_						:    Optional[Any]      ,		a_						:    Tuple=False							):



						"""simple docstring"""




						if return_tensors:
									return model_outputs[0]
						if self.framework == "pt":
									return model_outputs[0].tolist()
						elif self.framework == "tf":
									return model_outputs[0].numpy().tolist()






			def __call__(      self						:    Union[str, Any]      ,		*a_						:    Union[str, Any]      ,		**a_						:    List[Any]							):



						"""simple docstring"""




						return super().__call__(*a_      ,		**a_							)












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					(       _UpperCamelCase      ):


	'''simple docstring'''





	_A													=				42
	_A													=				42


if is_transformers_available() and is_torch_available():
			from .pipeline_semantic_stable_diffusion import SemanticStableDiffusionPipeline


