cli.main
cli.main
Click CLI definitions for various axolotl commands.
Functions
Name | Description |
---|---|
cli | Axolotl CLI - Train and fine-tune large language models |
evaluate | Evaluate a model. |
fetch | Fetch example configs or other resources. |
inference | Run inference with a trained model. |
merge_lora | Merge trained LoRA adapters into a base model. |
merge_sharded_fsdp_weights | Merge sharded FSDP model weights. |
preprocess | Preprocess datasets before training. |
train | Train or fine-tune a model. |
cli
cli.main.cli()
Axolotl CLI - Train and fine-tune large language models
evaluate
**kwargs) cli.main.evaluate(ctx, config, launcher,
Evaluate a model.
Parameters
Name | Type | Description | Default |
---|---|---|---|
ctx | click.Context | Click context for extra args. | required |
config | str | Path to axolotl config YAML file. |
required |
launcher | str | Launcher to use for multi-GPU evaluation (“accelerate”, “torchrun”, or “python”). | required |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |
fetch
cli.main.fetch(directory, dest)
Fetch example configs or other resources.
Available directories: - examples: Example configuration files - deepspeed_configs: DeepSpeed configuration files
Parameters
Name | Type | Description | Default |
---|---|---|---|
directory | str | One of examples , deepspeed_configs . |
required |
dest | Optional[str] | Optional destination directory. | required |
inference
**kwargs) cli.main.inference(ctx, config, launcher, gradio,
Run inference with a trained model.
Parameters
Name | Type | Description | Default |
---|---|---|---|
ctx | click.Context | Click context for extra args. | required |
config | str | Path to axolotl config YAML file. |
required |
launcher | str | Launcher to use for multi-GPU inference (“accelerate”, “torchrun”, or “python”). | required |
gradio | bool | Whether to use Gradio browser interface or command line for inference. | required |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |
merge_lora
**kwargs) cli.main.merge_lora(config,
Merge trained LoRA adapters into a base model.
Parameters
Name | Type | Description | Default |
---|---|---|---|
config | str | Path to axolotl config YAML file. |
required |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |
merge_sharded_fsdp_weights
**kwargs) cli.main.merge_sharded_fsdp_weights(ctx, config, launcher,
Merge sharded FSDP model weights.
Parameters
Name | Type | Description | Default |
---|---|---|---|
ctx | click.Context | Click context for extra args. | required |
config | str | Path to axolotl config YAML file. |
required |
launcher | str | Launcher to use for weight merging (“accelerate”, “torchrun”, or “python”). | required |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |
preprocess
=None, **kwargs) cli.main.preprocess(config, cloud
Preprocess datasets before training.
Parameters
Name | Type | Description | Default |
---|---|---|---|
config | str | Path to axolotl config YAML file. |
required |
cloud | Optional[str] | Path to a cloud accelerator configuration file. | None |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |
train
cli.main.train(
ctx,
config,='accelerate',
launcher=None,
cloud=None,
sweep**kwargs,
)
Train or fine-tune a model.
Parameters
Name | Type | Description | Default |
---|---|---|---|
ctx | click.Context | Click context for extra args. | required |
config | str | Path to axolotl config YAML file. |
required |
launcher | Literal['accelerate', 'torchrun', 'python'] | Launcher to use for multi-GPU training (“accelerate”, “torchrun”, or “python”). | 'accelerate' |
cloud | str | None | Path to a cloud accelerator configuration file | None |
sweep | str | None | Path to YAML config for sweeping hyperparameters. | None |
kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
{} |