explosion / spaCy

💫 Industrial-strength Natural Language Processing (NLP) in Python
https://spacy.io
MIT License
29.82k stars 4.37k forks source link

Spacy 2.3 'with nlp.disable_pipes()' does not properly restore the pipes. #5695

Closed eaporetsky closed 4 years ago

eaporetsky commented 4 years ago

How to reproduce the behaviour

When I run the example https://spacy.io/usage/training/#example-train-ner with a pretrained model en_core_web_md the with nlp.disable_pipes(): does not get properly closed and the saved model only has the ner component, not the tagger and parser. However if I do the normal disable flow without the context manager disabled.restore() it works fine.

Seems like a bug to me but wondering if others can reproduce.

Your Environment

adrianeboyd commented 4 years ago

Thanks for the report! I screwed up the with syntax when I added the warnings filter. It should be fixed now in master by #5690, so if you look at the current version it should be correct: https://github.com/explosion/spaCy/blob/master/examples/training/train_ner.py

(Permalink: https://github.com/explosion/spaCy/blob/2bd78c39e33b90f788b1121b93b3b098c4c4af10/examples/training/train_ner.py)

svlandeg commented 4 years ago

Should be fixed so closing this - but do let us know if you still run into issues with the new version on master !

eaporetsky commented 4 years ago

Awesome - you guys are fast!

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.