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 save some embeddings by default like this:
collection = client.get_or_create_collection(name=db_name)
Then, i can fetch data by DefaultEmbeddingFunction() like:
emb_fn = embedding_functions.DefaultEmbeddingFunction()
collection = client.get_or_create_collection(name=db_name, embedding_function=emb_fn) # It's work
But i can't fetch data by all-MiniLM-L6-v2 like:
emb_fn = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")
collection = client.get_or_create_collection(name=db_name, embedding_function=emb_fn) # It's not work
What's the different between DefaultEmbeddingFunction and SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")?
@h3clikejava, thanks for raising this. Let's start with some background:
Default EF uses onnx runtime + mean pooling, resulting in 384-dimensional embeddings
ST does everything out of the box and again produces 384-dimensional embeddings
Under normal circumstances, you should not have trouble swapping between the two, as Chroma will accept queries using 384-dimensional embeddings even though there are slight differences in the output embeddings (in the order of 1-e4/1-e5 range).
That said, when you say it won't work, do you mean you get an error? Can you share the error?
What happened?
I save some embeddings by default like this:
collection = client.get_or_create_collection(name=db_name)
Then, i can fetch data by DefaultEmbeddingFunction() like:
emb_fn = embedding_functions.DefaultEmbeddingFunction()
collection = client.get_or_create_collection(name=db_name, embedding_function=emb_fn) # It's work
But i can't fetch data by all-MiniLM-L6-v2 like:
emb_fn = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")
collection = client.get_or_create_collection(name=db_name, embedding_function=emb_fn) # It's not work
What's the different between DefaultEmbeddingFunction and SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")?
Versions
ChromaDB V0.5.3, python v3.10.11, MacOS 15.0 Beta (24A5327a)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: