From 5d605d539d097f6168d7d95869c9242290b87fd1 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 9 Dec 2020 10:57:55 +1100 Subject: [PATCH] Remove output_file from init_config helper --- spacy/cli/init_config.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spacy/cli/init_config.py b/spacy/cli/init_config.py index 615132deb..81ac6c9fc 100644 --- a/spacy/cli/init_config.py +++ b/spacy/cli/init_config.py @@ -45,15 +45,15 @@ def init_config_cli( if isinstance(optimize, Optimizations): # instance of enum from the CLI optimize = optimize.value pipeline = string_to_list(pipeline) + is_stdout = str(output_file) == "-" config = init_config( - output_file, lang=lang, pipeline=pipeline, optimize=optimize, cpu=cpu, pretraining=pretraining, + silent=is_stdout, ) - is_stdout = str(output_file) == "-" save_config(config, output_file, is_stdout=is_stdout) @@ -120,16 +120,15 @@ def fill_config( def init_config( - output_file: Path, *, lang: str, pipeline: List[str], optimize: str, cpu: bool, pretraining: bool = False, + silent: bool = True, ) -> Config: - is_stdout = str(output_file) == "-" - msg = Printer(no_print=is_stdout) + msg = Printer(no_print=silent) with TEMPLATE_PATH.open("r") as f: template = Template(f.read()) # Filter out duplicates since tok2vec and transformer are added by template