Add docs for init fill-config-transformer

This commit is contained in:
shadeMe 2023-08-08 13:44:35 +02:00
parent 0a0476cbfd
commit 3ab669ae6a
No known key found for this signature in database
GPG Key ID: 6FCA9FC635B2A402

View File

@ -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. |
<Accordion title="Example outputs" spaced>