Can't load model from config file: no [nlp] section found
I have a config.cfg file very simple
[nlp] lang = "el" pipeline = ["transformer", "ner"] components = ["transformer", "ner"]
[components]
[components.transformer] factory = "transformer" model = "amichailidis/greek_legal_bert_v2-finetuned-ner"
[components.ner] factory = "ner" source = "transformer"
and when I try to load it
config_path = "/config.cfg"
print(f"Loading model 'amichailidis/greek_legal_bert_v2-finetuned-ner' via config: {config_path}")
Load the pipeline from the configuration file
This will download the model from Hugging Face Hub if not cached
nlp = spacy.util.load_model_from_config(config_path)
print("Model loaded successfully.")
I receive this error:
File "/home/luis/projects/spacy/spacy-greek.py", line 13, in
/config.cfg
but as you can see the config file has a nlp section