Inconsistent behaviour with --code
flag for train
cli
#9910
-
How to reproduce the behaviourI am trying to train a relation extraction model using spaCy and would like to be able to call the train(config_path, output_path=model_output_path / "rel",
overrides={"paths.train": f"{train_data_path}",
"paths.dev": f"{dev_data_path}",
"code": "custom_functions.py",
"components.ner.source": f"{best_ner_model_path}"
}) This results in the following error: ✘ Error parsing config overrides
code not a section value that can be overwritten However, I can use the CLI to successfully run training using the There seems to be an inconsistency between the expected behaviour of the Info about spaCy
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, Lines 18 to 54 in 93e9bf6 |
Beta Was this translation helpful? Give feedback.
-
Ah ok thanks for pointing that out. Is there a way to pass in the same dictionary of |
Beta Was this translation helpful? Give feedback.
Hi,
--code
isn't an override in this sense. Overrides are only for overriding a value in the config. You want to use thecode_path
option with the methodtrain_cli
(or manage this import in some other way in your script):spaCy/spacy/cli/train.py
Lines 18 to 54 in 93e9bf6