From 8a4200d4e9f1482f214169ce62b2a8b65789d4d7 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 2 Mar 2021 15:53:30 +0100 Subject: [PATCH] Omit unused tok2vec/transformer components Omit unused tok2vec/transformer components in quickstart template. --- spacy/cli/templates/quickstart_training.jinja | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/cli/templates/quickstart_training.jinja b/spacy/cli/templates/quickstart_training.jinja index 89c8ec2d4..38fc23272 100644 --- a/spacy/cli/templates/quickstart_training.jinja +++ b/spacy/cli/templates/quickstart_training.jinja @@ -16,7 +16,11 @@ gpu_allocator = null [nlp] lang = "{{ lang }}" +{%- if "tagger" in components or "morphologizer" in components or "parser" in components or "ner" in components or "entity_linker" in components or (("textcat" in components or "textcat_multilabel" in components) and optimize == "accuracy") -%} {%- set full_pipeline = ["transformer" if use_transformer else "tok2vec"] + components %} +{%- else -%} +{%- set full_pipeline = components %} +{%- endif %} pipeline = {{ full_pipeline|pprint()|replace("'", '"')|safe }} batch_size = {{ 128 if hardware == "gpu" else 1000 }}