Facing an error while loading HF embeddings in LlamaIndex

I was trying to load embeddings like this.

from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.core import Settings
Settings.embed_model = HuggingFaceEmbedding(

and the reranker like this.

from llama_index.core.postprocessor import SentenceTransformerRerank
rerank = SentenceTransformerRerank(
model=“cross-encoder/ms-marco-MiniLM-L-12-v2”, top_n=3

Both show an error.

RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback):
module ‘torch._subclasses’ has no attribute ‘functional_tensor’

This is due to the version change in Llama-Index. I tried to follow through the changes but I dont know why this is not working.

Would be very grateful if anyone can help me out with this.