input_ids=torch.tensor([tokenizer.encode("Here is some text to encode")])
input_ids=torch.tensor([tokenizer.encode("Here is some text to encode",add_special_tokens=True)])# Add special tokens takes care of adding [CLS], [SEP], <s>... tokens in the right way for each model.
withtorch.no_grad():
last_hidden_states=model(input_ids)[0]# Models outputs are now tuples