generative-ai
generative-ai copied to clipboard
Getting Error with custom embedding function
[~/.local/lib/python3.10/site-packages/chromadb/db/index/hnswlib.py](https://localhost:8080/#) in add(self, ids, embeddings, update)
137 """Add or update embeddings to the index"""
138
--> 139 dim = len(embeddings[0])
140
141 if self._index is None:
IndexError: list index out of range
Hi @Aakif-cloud , this can happen if the embedding model was not (for some reason) successfully able to create an embedding for the input text, and so the embeddings variable becomes empty. You may want to consider doing a check that each embedding has the length you're expecting before adding it to your vector database.
Where can i get the Embedding id?