rasa: Rasa train nlu, bert, finetuned weight, Error: from_pt set to False
Description of Problem:
The rasa cli does not support loading a bert model that is trained from pytorch.
It gives the following error
OSError: Error no file named ['pytorch_model.bin', 'tf_model.h5'] found in directory ..\model\deploy_transformer or from_pt set to False
My config yml:
- name: HFTransformersNLP
model_weights: "C:\\work_directory\\nlp\\model\\transformers\bert"
model_name: "bert"
My directory in the model folder:
- config.json
- model.ckpt.data-00000-of-00001
- model.ckpt.index
- model.ckpt.meta
- vocab.txt
- pytorch_model.bin
Overview of the Solution:
I now need to add “from_pt=True” manually in the rasa/nlu/utils/hugging_face/hf_transformers.py : 84 in order to use pytorch model. A better solution is to be able to do so in the config.yml file
Examples (if relevant):
Blockers (if relevant):
Definition of Done:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (2 by maintainers)
Sure! Here:
That said this was before I migrated the project to rasa 2.0. After that I’d only use spacy, so I don’t know if it still works.
Thx @dakshvar22 That was the wrong script which use .ckpt This is the right script
Btw, for those may have the same problem. The transformer scripts have bugs. Please refer to this and this to fix.