ebanalyse / NERDA

Framework for fine-tuning pretrained transformers for Named-Entity Recognition (NER) tasks
MIT License
154 stars 35 forks source link

How to save the model after training? #14

Closed atoutou closed 3 years ago

atoutou commented 3 years ago

I have trained a NERDA model and want to save the model but I can't find any function in the NERDA to do this. How do I save the model?

截圖 2021-04-19 下午5 12 29
Hansyvea commented 3 years ago

you could use the torch save and load method

import torch
torch.save(model, 'model.pt')

and load it back model = torch.load('model.pt')

atoutou commented 3 years ago

Thanks for your quick reply. It works properly.