From 3ab669ae6aca8440b0cb0ecaa745e05163e17689 Mon Sep 17 00:00:00 2001 From: shadeMe Date: Tue, 8 Aug 2023 13:44:35 +0200 Subject: [PATCH] Add docs for `init fill-config-transformer` --- website/docs/api/cli.mdx | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/website/docs/api/cli.mdx b/website/docs/api/cli.mdx index 284b5b602..f99cbbfcb 100644 --- a/website/docs/api/cli.mdx +++ b/website/docs/api/cli.mdx @@ -185,6 +185,26 @@ $ 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"} + +Auto-fill the Hugging Face model hyperpameters 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. + +```bash +$ python -m spacy init fill-config-transformer [base_path] [output_file] +``` + +| 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. | + ### init vectors {id="init-vectors",version="3",tag="command"} Convert [word vectors](/usage/linguistic-features#vectors-similarity) for use @@ -1026,13 +1046,13 @@ Analyze word- or sentencepiece stats. $ python -m spacy debug pieces [config_path] [code_path] [transformer_name] ``` -| Name | Description | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `config_path` | Path to config file. ~~Union[Path, str] (positional)~~ | -| `code_path` | Path to Python file with additional code (registered functions) to be imported. ~~Union[Path, str] (option)~~ | -| `transformer_name` | Name of the transformer pipe to gather piece statistics for (default: first transformer pipe). ~~str (option)~~ | -| overrides | Config parameters to override. Should be options starting with `--` that correspond to the config section and value to override, e.g. `--paths.train ./train.spacy`. ~~Any (option/flag)~~ | -| **PRINTS** | Debugging information. | +| Name | Description | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `config_path` | Path to config file. ~~Union[Path, str] (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)~~ | +| overrides | Config parameters to override. Should be options starting with `--` that correspond to the config section and value to override, e.g. `--paths.train ./train.spacy`. ~~Any (option/flag)~~ | +| **PRINTS** | Debugging information. |