


"""simple docstring"""






import unittest
from dataclasses import dataclass

import pytest

from accelerate.commands.config.config_args import SageMakerConfig
from accelerate.utils import ComputeEnvironment
from accelerate.utils.launch import _convert_nargs_to_dict





@dataclass
class      lowerCamelCase__   (     lowerCamelCase_				):







					"""simple docstring"""


					__a	       =							ComputeEnvironment.AMAZON_SAGEMAKER
					__a	       =							True
					__a	       =							"""ml.p3.2xlarge"""
					__a	       =							"""accelerate_sagemaker_execution_role"""
					__a	       =							"""hf-sm"""
					__a	       =							"""us-east-1"""
					__a	       =							1
					__a	       =							"""accelerate-sagemaker-1"""
					__a	       =							"""1.6"""
					__a	       =							"""4.4"""
					__a	       =							"""train.py"""
					__a	       =							[
					    """--model_name_or_path""",
					    """bert""",
					    """--do_train""",
					    """False""",
					    """--epochs""",
					    """3""",
					    """--learning_rate""",
					    """5e-5""",
					    """--max_steps""",
					    """50.5""",
					]
					__a	       =							[
					    """--model_name_or_path""",
					    """bert""",
					    """--do_train""",
					    """--do_test""",
					    """False""",
					    """--do_predict""",
					    """--epochs""",
					    """3""",
					    """--learning_rate""",
					    """5e-5""",
					    """--max_steps""",
					    """50.5""",
					]






class      lowerCamelCase__   (     unittest.TestCase				):







					"""simple docstring"""


					def lowerCamelCase__							(       self    : Optional[int]  ):
												'''simple docstring'''






												__UpperCAmelCase   :						Union[str, Any]      							=					_convert_nargs_to_dict(MockLaunchConfig.success_training_script_args  )
												assert isinstance(converted_args["""model_name_or_path"""] ,       lowerCAmelCase__  )
												assert isinstance(converted_args["""do_train"""] ,       lowerCAmelCase__  )
												assert isinstance(converted_args["""epochs"""] ,       lowerCAmelCase__  )
												assert isinstance(converted_args["""learning_rate"""] ,       lowerCAmelCase__  )
												assert isinstance(converted_args["""max_steps"""] ,       lowerCAmelCase__  )

												with pytest.raises(lowerCAmelCase__  ):
																			_convert_nargs_to_dict(MockLaunchConfig.fail_training_script_args  )




"""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'''])


