cli.art
+cli.art
Axolotl ASCII logo utils.
+Functions
+| Name | +Description | +
|---|---|
| print_axolotl_text_art | +Prints axolotl ASCII art. | +
print_axolotl_text_art
+cli.art.print_axolotl_text_art()Prints axolotl ASCII art.
+ + +diff --git a/.nojekyll b/.nojekyll index df3be972b..dfb6d68bb 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -4cff29b7 \ No newline at end of file +dc3808ad \ No newline at end of file diff --git a/docs/api/cli.args.html b/docs/api/cli.args.html index 54eb64d70..774f3cf67 100644 --- a/docs/api/cli.args.html +++ b/docs/api/cli.args.html @@ -589,9 +589,7 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true}); debug_num_examples=0, prompter=None, shard=False, - main_process_port=None, - num_processes=None, -) +)
Dataclass with CLI arguments for axolotl train command.
cli.main.evaluate(config, accelerate, **kwargs)cli.main.evaluate(ctx, config, launcher, **kwargs)Evaluate a model.
| ctx | +click.Context | +Click context for extra args. | +required | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config | str | Path to axolotl config YAML file. |
required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accelerate | -bool | -Whether to use accelerate launcher. |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
@@ -645,16 +651,16 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
| ctx | +click.Context | +Click context for extra args. | +required | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config | str | Path to axolotl config YAML file. |
required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accelerate | -bool | -Whether to use accelerate launcher. |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
@@ -733,16 +745,16 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
| ctx | +click.Context | +Click context for extra args. | +required | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config | str | Path to axolotl config YAML file. |
required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accelerate | -bool | -Whether to use accelerate launcher. |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
@@ -821,15 +839,22 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
| ctx | +click.Context | +Click context for extra args. | +required | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config | str | Path to axolotl config YAML file. |
required | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accelerate | -bool | -Whether to use accelerate launcher. |
-required | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcher | +Literal['accelerate', 'torchrun', 'python'] | +Launcher to use for multi-GPU training (“accelerate”, “torchrun”, or “python”). | +'accelerate' |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cloud | -Optional[str] | +str | None | Path to a cloud accelerator configuration file | None |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sweep | -Optional[str] | +str | None | Path to YAML config for sweeping hyperparameters. | None |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kwargs | Additional keyword arguments which correspond to CLI args or axolotl config options. |
diff --git a/docs/api/cli.utils.args.html b/docs/api/cli.utils.args.html
new file mode 100644
index 000000000..a3ade4d0f
--- /dev/null
+++ b/docs/api/cli.utils.args.html
@@ -0,0 +1,1088 @@
+
+
+
+
+
+
+
+
+
+
| Name | -Description | -
|---|---|
| add_options_from_config | -Create Click options from the fields of a Pydantic model. | -
| add_options_from_dataclass | -Create Click options from the fields of a dataclass. | -
| build_command | -Build command list from base command and options. | -
| download_file | -Download a single file and return its processing status. | -
| fetch_from_github | -Sync files from a specific directory in the GitHub repository. | -
| filter_none_kwargs | -Wraps function to remove None-valued kwargs. |
-
| load_model_and_tokenizer | -Helper function for loading a model, tokenizer, and processor specified in the given axolotl |
-
| strip_optional_type | -Extracts the non-None type from an Optional / Union type. |
-
cli.utils.add_options_from_config(config_class)Create Click options from the fields of a Pydantic model.
-| Name | -Type | -Description | -Default | -
|---|---|---|---|
| config_class | -Type[BaseModel] | -PyDantic model with fields to parse from the CLI | -required | -
| Name | -Type | -Description | -
|---|---|---|
| - | Callable | -Function decorator for Axolotl CLI command. | -
cli.utils.add_options_from_dataclass(config_class)Create Click options from the fields of a dataclass.
-| Name | -Type | -Description | -Default | -
|---|---|---|---|
| config_class | -Type[Any] | -Dataclass with fields to parse from the CLI. | -required | -
| Name | -Type | -Description | -
|---|---|---|
| - | Callable | -Function decorator for Axolotl CLI command. | -
cli.utils.build_command(base_cmd, options)Build command list from base command and options.
-| 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 | -
| Name | -Type | -Description | -
|---|---|---|
| - | list[str] | -List of strings giving shell command. | -
cli.utils.download_file(file_info, raw_base_url, dest_path, dir_prefix)Download a single file and return its processing status.
-| Name | -Type | -Description | -Default | -
|---|---|---|---|
| file_info | -tuple | -Tuple of (file_path, remote_sha). | -required | -
| raw_base_url | -str | -Base URL for raw GitHub content. | -required | -
| dest_path | -Path | -Local destination directory. | -required | -
| dir_prefix | -str | -Directory prefix to filter files. | -required | -
| Name | -Type | -Description | -
|---|---|---|
| - | tuple[str, str] | -Tuple of (file_path, status) where status is ‘new’, ‘updated’, or ‘unchanged’. | -
cli.utils.fetch_from_github(dir_prefix, dest_dir=None, max_workers=5)Sync files from a specific directory in the GitHub repository. -Only downloads files that don’t exist locally or have changed.
-| Name | -Type | -Description | -Default | -
|---|---|---|---|
| dir_prefix | -str | -Directory prefix to filter files (e.g., ‘examples/’, ‘deepspeed_configs/’). | -required | -
| dest_dir | -str | None | -Local destination directory. | -None |
-
| max_workers | -int | -Maximum number of concurrent downloads. | -5 |
-
cli.utils.filter_none_kwargs(func)Wraps function to remove None-valued kwargs.
| Name | -Type | -Description | -Default | -
|---|---|---|---|
| func | -Callable | -Function to wrap. | -required | -
| Name | -Type | -Description | -
|---|---|---|
| - | Callable | -Wrapped function. | -
cli.utils.load_model_and_tokenizer(cfg, inference=False)Helper function for loading a model, tokenizer, and processor specified in the given axolotl
-config.
| Name | -Type | -Description | -Default | -
|---|---|---|---|
| cfg | -DictDefault | -Dictionary mapping axolotl config keys to values. |
-required | -
| inference | -bool | -Boolean denoting inference mode. | -False |
-
| Name | -Type | -Description | -
|---|---|---|
| - | tuple[PreTrainedModel, PreTrainedTokenizer | PreTrainedTokenizerFast | Any, ProcessorMixin | None] | -Tuple of (PreTrainedModel, PreTrainedTokenizer, ProcessorMixin). | -
cli.utils.strip_optional_type(field_type)Extracts the non-None type from an Optional / Union type.
| Name | -Type | -Description | -Default | -
|---|---|---|---|
| field_type | -type | str | None | -Type of field for Axolotl CLI command. | -required | -
| Name | -Type | -Description | -
|---|---|---|
| - | - | If the input type is Union[T, None] or Optional[T], returns T. Otherwise returns the input type unchanged. |
-
Init for axolotl.cli.utils module.
-