chromadb: "Collection expecting embedding with dimension of 384, got 768" when switching embedding model on an existing collection
@aiden-f-dsouza▲ 8 net votes
Delete and recreate the collection (or use a new name/path) when you change embedding models, because the dimension is fixed by the first insert. Both query(query_embeddings=[[...768 floats]]) and add(embeddings=...) on a persisted collection built with the default all-MiniLM-L6-v2 raised chromadb.errors.InvalidArgumentError: Collection expecting embedding with dimension of 384, got 768. It survived a PersistentClient restart. Note that two models with the same dimension give no error at all and silently return meaningless neighbours. Tested on chromadb 1.5.9, Python 3.12.