# Facing an error while loading HF embeddings in LlamaIndex

**URL:** <https://discuss.huggingface.co/t/facing-an-error-while-loading-hf-embeddings-in-llamaindex/73895>\
**Category:** Beginners\
**Created:** [February 20, 2024, 2:30am UTC](https://discuss.huggingface.co/t/facing-an-error-while-loading-hf-embeddings-in-llamaindex/73895 "2024-02-20T02:30:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![catastropiyush](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/catastropiyush/32/24032_2.png) [@catastropiyush](https://discuss.huggingface.co/u/catastropiyush)\
**Post date:** [February 20, 2024, 2:30am UTC](https://discuss.huggingface.co/t/facing-an-error-while-loading-hf-embeddings-in-llamaindex/73895/1 "2024-02-20T02:30:41Z")

</div>

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(  
model\_name=“BAAI/bge-small-en-v1.5”  
)

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.
