From ef4d4f793b91277dec8e644192dd188aa2cd9020 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Tue, 19 Oct 2021 21:28:20 +0000 Subject: [PATCH] Clarify how to change base Transformer model (#9498) * Add note about how the model name is used * Add link to TransformersModel docs, separate paragraph * Local link * Revise docs * Update website/docs/usage/embeddings-transformers.md * Update website/docs/usage/embeddings-transformers.md Co-authored-by: Sofie Van Landeghem --- website/docs/usage/embeddings-transformers.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website/docs/usage/embeddings-transformers.md b/website/docs/usage/embeddings-transformers.md index 253b3d0b5..cea270aa5 100644 --- a/website/docs/usage/embeddings-transformers.md +++ b/website/docs/usage/embeddings-transformers.md @@ -379,6 +379,21 @@ of potentially overlapping `Span` objects to process by the transformer. Several to process the whole document or individual sentences. When the config is resolved, the function is created and passed into the model as an argument. +The `name` value is the name of any [HuggingFace model](huggingface-models), +which will be downloaded automatically the first time it's used. You can also +use a local file path. For full details, see the +[`TransformerModel` docs](/api/architectures#TransformerModel). + +[huggingface-models]: + https://huggingface.co/models?library=pytorch&sort=downloads + +A wide variety of PyTorch models are supported, but some might not work. If a +model doesn't seem to work feel free to open an +[issue](https://github.com/explosion/spacy/issues). Additionally note that +Transformers loaded in spaCy can only be used for tensors, and pretrained +task-specific heads or text generation features cannot be used as part of +the `transformer` pipeline component. + Remember that the `config.cfg` used for training should contain **no missing