You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from bert_deid.model import Transformer
# load in a trained model
model_path = 'bert_deid_model'
deid_model = Transformer(model_path)
with open('tests/example_note.txt', 'r') as fp:
text = ''.join(fp.readlines())
print(deid_model.apply(text, repl='___'))
I am using above snippet of code and providing model path as pre-trained model path.
Getting the following error
RuntimeError: Error(s) in loading state_dict for BertForTokenClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([25, 1024]) from checkpoint, the shape in current model is torch.Size([2, 1024]).
size mismatch for classifier.bias: copying a param with shape torch.Size([25]) from checkpoint, the shape in current model is torch.Size([2]).
I am using above snippet of code and providing model path as pre-trained model path.
Getting the following error
@alistairewj
The text was updated successfully, but these errors were encountered: