KeyError: 'logits'
Hi,I have created and trained a tokenizer. I then loaded usingtokenizer = PreTrainedTokenizerFast.from_pretrained(‘bert-base-he’)I then created a model using starting to loadmodel = BertForPreTraining.from_pretrained(‘bert-base-uncased’)I did everything to train the model both with the MLM approach and the NSP approach and everything worked fine. So I saved the model in my google drive.I now want to use the model but I get the following error:KeyError: ‘logits’This is the code I use:Initialize MLM pipelinefrom transformers import pipelinemlm = pipeline(“fill-mask”,model = torch.load(‘BHSA01.pt’, map_location=torch.device(‘cpu’)),#itseems it wants just the model name in .json formattokenizer = PreTrainedTokenizerFast.from_pretrained(‘bert-base-he’))Get mask tokenmask = mlm.tokenizer.mask_tokenGet results for a particular masked phrasephrase = f’{mask} בְּ רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַ שָּׁמַ֖יִם וְ אֵ֥ת הָ’result = mlm(phrase)Print resultprint(result)Just one last note. Biblical Hebrew is written right to left. Can that create problem?Thanks a lot for Your help!Elia