You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use Cohere's embeddings in chromadb but getting the attached error. Here is my code:
from chromadb.utils import embedding_functions
cohere_ef = embedding_functions.CohereEmbeddingFunction(api_key=cohere_api_key)
cohere_ef(['test'])
Any suggestions? Thanks!
Versions
Chroma v0.5.20, Python v3.10.14
Relevant log output
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[9], line 3
1 from chromadb.utils import embedding_functions
2 cohere_ef = embedding_functions.CohereEmbeddingFunction(api_key=cohere_api_key)
----> 3 cohere_ef(['test'])
File ~/git/infolinc-chunking-evaluation/.venv/lib/python3.10/site-packages/chromadb/api/types.py:462, in EmbeddingFunction.__init_subclass__.<locals>.__call__(self, input)
460 result = call(self, input)
461 assert result is not None
--> 462 return validate_embeddings(cast(Embeddings, normalize_embeddings(result)))
File ~/git/infolinc-chunking-evaluation/.venv/lib/python3.10/site-packages/chromadb/api/types.py:82, in normalize_embeddings(target)
79 if target.ndim == 2:
80 return list(target)
---> 82 raise ValueError(
83 f"Expected embeddings to be a list of floats or ints, a list of lists, a numpy array, or a list of numpy arrays, got {target}"
84 )
ValueError: Expected embeddings to be a list of floats or ints, a list of lists, a numpy array, or a list of numpy arrays, got [('response_type', 'embeddings_floats'), ('id', '1db95cbd-05b4-4081-a75d-d552124477e9'), ('embeddings', [[2.3085938, 0.04901123, -0.16
The text was updated successfully, but these errors were encountered:
hey @hananshandler, thanks for reporting this. A while ago Cohere bumped their client to v5, we have a relatively long standing PR #2262 (plus a few others following it) that attempt to fix the problem with using the new client.
What happened?
I'm attempting to use Cohere's embeddings in chromadb but getting the attached error. Here is my code:
from chromadb.utils import embedding_functions
cohere_ef = embedding_functions.CohereEmbeddingFunction(api_key=cohere_api_key)
cohere_ef(['test'])
Any suggestions? Thanks!
Versions
Chroma v0.5.20, Python v3.10.14
Relevant log output
The text was updated successfully, but these errors were encountered: