


"""simple docstring"""






import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


UpperCAmelCase    :     int   						=		[
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]
def      lowerCamelCase       (     _UpperCamelCase		:      Optional[Any]       ,			_UpperCamelCase		:      Union[str, Any]=None       ,			_UpperCamelCase		:      List[Any]=None       ,			_UpperCamelCase		:      int=None							)		->       int:

							'''simple docstring'''



							__UpperCAmelCase   :						Union[str, Any]      							=					True
							while ask_again:
														__UpperCAmelCase   :						Any      							=					input(SCREAMING_SNAKE_CASE_							)
														try:
																					if default is not None and len(SCREAMING_SNAKE_CASE_							) == 0:
																												return default
																					return convert_value(SCREAMING_SNAKE_CASE_							) if convert_value is not None else result
														except Exception:
																					if error_message is not None:
																												print(SCREAMING_SNAKE_CASE_							)
def      lowerCamelCase       (     _UpperCamelCase		:      str       ,			_UpperCamelCase		:      str=[]       ,			_UpperCamelCase		:      int=None       ,			_UpperCamelCase		:      Union[str, Any]=0							)		->       List[Any]:

							'''simple docstring'''



							__UpperCAmelCase   :						Dict      							=					BulletMenu(SCREAMING_SNAKE_CASE_       ,			SCREAMING_SNAKE_CASE_							)
							__UpperCAmelCase   :						Union[str, Any]      							=					menu.run(default_choice=SCREAMING_SNAKE_CASE_							)
							return convert_value(SCREAMING_SNAKE_CASE_							) if convert_value is not None else result
def      lowerCamelCase       (     _UpperCamelCase		:      Any							)		->       str:

							'''simple docstring'''



							__UpperCAmelCase   :						Union[str, Any]      							=					int(SCREAMING_SNAKE_CASE_							)
							return ComputeEnvironment(["""LOCAL_MACHINE""", """AMAZON_SAGEMAKER"""][value]							)
def      lowerCamelCase       (     _UpperCamelCase		:      str							)		->       Union[str, Any]:

							'''simple docstring'''



							__UpperCAmelCase   :						List[str]      							=					int(SCREAMING_SNAKE_CASE_							)
							return DistributedType(["""NO""", """MULTI_CPU""", """MULTI_XPU""", """MULTI_GPU""", """MULTI_NPU""", """TPU"""][value]							)
def      lowerCamelCase       (     _UpperCamelCase		:      Optional[Any]							)		->       Any:

							'''simple docstring'''



							__UpperCAmelCase   :						Optional[Any]      							=					int(SCREAMING_SNAKE_CASE_							)
							return DynamoBackend(DYNAMO_BACKENDS[value]							).value
def      lowerCamelCase       (     _UpperCamelCase		:      Optional[int]							)		->       Optional[Any]:

							'''simple docstring'''



							__UpperCAmelCase   :						Optional[Any]      							=					int(SCREAMING_SNAKE_CASE_							)
							return PrecisionType(["""no""", """fp16""", """bf16""", """fp8"""][value]							)
def      lowerCamelCase       (     _UpperCamelCase		:      int							)		->       Dict:

							'''simple docstring'''



							__UpperCAmelCase   :						int      							=					int(SCREAMING_SNAKE_CASE_							)
							return SageMakerDistributedType(["""NO""", """DATA_PARALLEL""", """MODEL_PARALLEL"""][value]							)
def      lowerCamelCase       (     _UpperCamelCase		:      Optional[int]							)		->       List[str]:

							'''simple docstring'''



							return {"yes": True, "no": False}[value.lower()]





class      lowerCamelCase__   (     argparse.RawDescriptionHelpFormatter				):







					"""simple docstring"""


					def lowerCamelCase__							(       self    : Optional[int] ,       UpperCamelCase    : int ,       UpperCamelCase    : Optional[Any] ,       UpperCamelCase    : Union[str, Any] ,       UpperCamelCase    : Any  ):
												'''simple docstring'''






												__UpperCAmelCase   :						List[str]      							=					super()._format_usage(lowerCAmelCase__ ,       lowerCAmelCase__ ,       lowerCAmelCase__ ,       lowerCAmelCase__  )
												__UpperCAmelCase   :						Tuple      							=					usage.replace("""<command> [<args>] """ ,       """"""  )
												return usage




"""simple docstring"""




__UpperCamelCase						=      frozenset(
    [
        '''prompt''',
        '''height''',
        '''width''',
        '''guidance_scale''',
        '''negative_prompt''',
        '''prompt_embeds''',
        '''negative_prompt_embeds''',
        '''cross_attention_kwargs''',
    ]
)

__UpperCamelCase						=      frozenset(['''prompt''', '''negative_prompt'''])

__UpperCamelCase						=      frozenset([])

__UpperCamelCase						=      frozenset(['''image'''])

__UpperCamelCase						=      frozenset(
    [
        '''image''',
        '''height''',
        '''width''',
        '''guidance_scale''',
    ]
)

__UpperCamelCase						=      frozenset(['''image'''])

__UpperCamelCase						=      frozenset(
    [
        '''prompt''',
        '''image''',
        '''height''',
        '''width''',
        '''guidance_scale''',
        '''negative_prompt''',
        '''prompt_embeds''',
        '''negative_prompt_embeds''',
    ]
)

__UpperCamelCase						=      frozenset(['''prompt''', '''image''', '''negative_prompt'''])

__UpperCamelCase						=      frozenset(
    [
        # Text guided image variation with an image mask
        '''prompt''',
        '''image''',
        '''mask_image''',
        '''height''',
        '''width''',
        '''guidance_scale''',
        '''negative_prompt''',
        '''prompt_embeds''',
        '''negative_prompt_embeds''',
    ]
)

__UpperCamelCase						=      frozenset(['''prompt''', '''image''', '''mask_image''', '''negative_prompt'''])

__UpperCamelCase						=      frozenset(
    [
        # image variation with an image mask
        '''image''',
        '''mask_image''',
        '''height''',
        '''width''',
        '''guidance_scale''',
    ]
)

__UpperCamelCase						=      frozenset(['''image''', '''mask_image'''])

__UpperCamelCase						=      frozenset(
    [
        '''example_image''',
        '''image''',
        '''mask_image''',
        '''height''',
        '''width''',
        '''guidance_scale''',
    ]
)

__UpperCamelCase						=      frozenset(['''example_image''', '''image''', '''mask_image'''])

__UpperCamelCase						=      frozenset(['''class_labels'''])

__UpperCamelCase						=      frozenset(['''class_labels'''])

__UpperCamelCase						=      frozenset(['''batch_size'''])

__UpperCamelCase						=      frozenset([])

__UpperCamelCase						=      frozenset(['''batch_size'''])

__UpperCamelCase						=      frozenset([])

__UpperCamelCase						=      frozenset(
    [
        '''prompt''',
        '''audio_length_in_s''',
        '''guidance_scale''',
        '''negative_prompt''',
        '''prompt_embeds''',
        '''negative_prompt_embeds''',
        '''cross_attention_kwargs''',
    ]
)

__UpperCamelCase						=      frozenset(['''prompt''', '''negative_prompt'''])
__UpperCamelCase						=      frozenset(['''input_tokens'''])

__UpperCamelCase						=      frozenset(['''input_tokens'''])


