chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Bug]: Can not use custom embedding functions in server mode

Open rxy1212 opened this issue 2 years ago • 1 comments

What happened?

I use "docker compose up -d --build" to start a chroma server on Ubuntu 22.04. But when I use my own embedding functions, which works well in the client mode, in the client, the chroma.log shows " WARNING chromadb.api.models.Collection No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction". It seems that custom embedding functions does not work in server mode.

Versions

Chroma 0.3.21 Python 3.10.6 Ubuntu 22.04

Relevant log output

No response

rxy1212 avatar May 05 '23 01:05 rxy1212

Hi - I believe this is a confusing error message from the server. Technically, embedding functions only ever run on the client right now. server-side embedding functions are yet to be supported.

Does the data actually get stored properly for you and is this a UX issue or are you not seeing data when you query/get?

HammadB avatar May 05 '23 17:05 HammadB

@HammadB You are right. It is a confusing error message from the server.

rxy1212 avatar May 06 '23 01:05 rxy1212

Re opening this as we should clean up the confusing error message!

HammadB avatar May 08 '23 18:05 HammadB

Yes , I got the same bug.

docker-compose up -d --build
import chromadb
from chromadb.config import Settings
chroma_client = chromadb.Client(Settings(chroma_api_impl="rest",
                                        chroma_server_host="localhost",
                                        chroma_server_http_port="8000"
                                    ))
chroma_client.heartbeat()

# output : 1683602373047580430000

get collection list

chroma_client.list_collections()

logs:

WARNING  chromadb.api.models.Collection No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction
ERROR    chromadb.server.fastapi 401 Client Error. 
Repository Not Found for url: https://huggingface.co/api/models/sentence-transformers/all-MiniLM-L6-v2.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password.

lingfengchencn avatar May 09 '23 03:05 lingfengchencn

closing in favor of - https://github.com/chroma-core/chroma/issues/705

jeffchuber avatar Nov 07 '23 19:11 jeffchuber