deeppavlov / DeepPavlov

An open source library for deep learning end-to-end dialog systems and chatbots.
https://deeppavlov.ai
Apache License 2.0
6.68k stars 1.15k forks source link

Torchcrf-import-fix #1653

Closed Hollyqui closed 1 year ago

Hollyqui commented 1 year ago

Currently the crf.py file includes the import "from torchcrf import..." which should be "from TorchCRF import..." and leads to errors when trying to load (at least) the ner_ontonotes_bert model for NER. The specific error thrown is "modulenotfounderror: No module named 'torchcrf'" despite installing the torchcrf module.

IgnatovFedor commented 1 year ago

Hi, @Hollyqui Thank you for your interest in DeepPavlov Library and your PR. I can't reproduce your error: import from torchcrf works like a charm, but from TorchCRF gives error. Could you please tell your OS, exact python version and installed DeepPavlov ant torchcrf versions?

IgnatovFedor commented 1 year ago

upd: There is package TorchCRF. I think, you installed it manually, but DeepPavlov uses pytorch-crf package. All model requirements could be installed either from CLI with python -m deeppavlov install <model_name> or from python with model = build_model('<model_name>', install=True)