Solved by lvwerra in post #3 
              
              
                Hi @slecraphi 
Just to elaborate on @ehalit’s correct approach here your example adapted for token classification: 
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertForTokenClassification.from_pretrained('bert-base-uncased')
inputs = tokenizer("Hello, my dog is cute", retur…