To clarify, the above code just returns the final hidden state of each token and not whole sentence embedding.
for sentence embedding you can try sentence-bert 71.
https://huggingface.co/sentence-transformers 114