# cli.utils.train

`cli.utils.train`

Utilities for axolotl train CLI command.

## Functions

Name | Description
--- | ---
build_command | Build command list from base command and options.
generate_config_files | Generate list of configuration files to process. Yields a tuple of the configuration file name and a boolean indicating
launch_training | Execute training with the given configuration.

### build_command

    cli.utils.train.build_command(base_cmd, options)

Build command list from base command and options.

#### Parameters

Name | Type | Description | Default
--- | --- | --- | ---
base_cmd | list[str] | Command without options. | required
options | dict[str, Any] | Options to parse and append to base command. | required

#### Returns

Name | Type | Description
--- | --- | ---
| list[str] | List of strings giving shell command.

### generate_config_files

    cli.utils.train.generate_config_files(config, sweep)

Generate list of configuration files to process. Yields a tuple of the configuration file name and a boolean indicating whether this is a group of configurations (i.e., a sweep).

#### Parameters

Name | Type | Description | Default
--- | --- | --- | ---
config | str | Base configuration file | required
sweep | str | None | Sweep configuration file | required

### launch_training

    cli.utils.train.launch_training(
        cfg_file,
        launcher,
        cloud,
        kwargs,
        launcher_args=None,
        use_exec=False,
    )

Execute training with the given configuration.