From 979b723993dd8d244ddcb116e3661d2f0ebb920e Mon Sep 17 00:00:00 2001 From: shadeMe Date: Mon, 14 Aug 2023 13:03:02 +0200 Subject: [PATCH] Update CLI command name, args --- website/docs/api/architectures.mdx | 2 +- website/docs/api/cli.mdx | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/website/docs/api/architectures.mdx b/website/docs/api/architectures.mdx index 1f5ec56d9..d11e64479 100644 --- a/website/docs/api/architectures.mdx +++ b/website/docs/api/architectures.mdx @@ -492,7 +492,7 @@ When loading the model [from the Hugging Face Hub](/api/curated-transformer#hf_trfencoder_loader), the model config's parameters must be same as the hyperparameters used by the pre-trained model. The -[`init fill-config-transformer`](/api/cli#init-fill-config-transformer) CLI +[`init fill-curated-transformer`](/api/cli#init-fill-curated-transformer) CLI command can be used to automatically fill in these values. ### spacy-curated-transformers.AlbertTransformer.v1 diff --git a/website/docs/api/cli.mdx b/website/docs/api/cli.mdx index dc6985a03..7df99ca2c 100644 --- a/website/docs/api/cli.mdx +++ b/website/docs/api/cli.mdx @@ -185,25 +185,29 @@ $ python -m spacy init fill-config [base_path] [output_file] [--diff] | `--help`, `-h` | Show help message and available arguments. ~~bool (flag)~~ | | **CREATES** | Complete and auto-filled config file for training. | -### init fill-config-transformer {id="init-fill-config-transformer",version="3.7",tag="command"} +### init fill-curated-transformer {id="init-fill-curated-transformer",version="3.7",tag="command"} -Auto-fill the Hugging Face model hyperpameters of a +Auto-fill the Hugging Face model hyperpameters and loader parameters of a [Curated Transformer](/api/curated-transformer) pipeline component in a [.cfg file](/usage/training#config). The name and revision of the Hugging Face -is read from the `initialize.components.transformer.encoder_loader` config -section. +can either be passed as command-line arguments or read from the +`initialize.components.transformer.encoder_loader` config section. ```bash -$ python -m spacy init fill-config-transformer [base_path] [output_file] [--code] [--name] +$ python -m spacy init fill-curated-transformer [base_path] [output_file] [--model-name] [--model-revision] [--pipe-name] [--code] ``` -| Name | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `base_path` | Path to base config to fill, e.g. generated by the [quickstart widget](/usage/training#quickstart). ~~Path (positional)~~ | -| `output_file` | Path to output `.cfg` file or "-" to write to stdout so you can pipe it to a file. Defaults to "-" (stdout). ~~Path (positional)~~ | -| `--code`, `-c` | Path to Python file with additional code to be imported. Allows [registering custom functions](/usage/training#custom-functions) for new architectures. ~~Optional[Path] \(option)~~ | -| `--name`, `-n` | Name of the curated transformer pipe whose config is to be filled. Defaults to the first transformer pipe. ~~Optional[str] (option)~~ | -| **CREATES** | Complete and auto-filled config file for training. | +TODO: update + +| Name | Description | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `base_path` | Path to base config to fill, e.g. generated by the [quickstart widget](/usage/training#quickstart). ~~Path (positional)~~ | +| `output_file` | Path to output `.cfg` file or "-" to write to stdout so you can pipe it to a file. Defaults to "-" (stdout). ~~Path (positional)~~ | +| `--model-name`, `-m` | Name of the Hugging Face model. Defaults to the model name in from the encoder loader config. ~~Optional[str] (option)~~ | +| `--model-revision`, `-r` | Revision of the Hugging Face model. Defaults to `main`. ~~Optional[str] (option)~~ | +| `--pipe-name`, `-n` | Name of the curated transformer pipe whose config is to be filled. Defaults to the first transformer pipe. ~~Optional[str] (option)~~ | +| `--code`, `-c` | Path to Python file with additional code to be imported. Allows [registering custom functions](/usage/training#custom-functions) for new architectures. ~~Optional[Path] \(option)~~ | +| **CREATES** | Complete and auto-filled config file for training. | ### init vectors {id="init-vectors",version="3",tag="command"}