Comments (6)
Thank you for the provided logs. I reproduced your test with a PersistentClient
(with a basic FastAPI implementation) and it works as expected and described by you. Here's a snippet of the code:
import chromadb
client = chromadb.PersistentClient(path=os.path.join(os.getcwd(), "chroma"))
client.get_or_create_collection("Test")
Logs:
INFO: Application startup complete.
INFO: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
INFO: 127.0.0.1:53838 - "POST /api/v1/test HTTP/1.1" 200 OK
INFO: Collection Test is not created.
INFO: 127.0.0.1:33750 - "POST /api/v1/test HTTP/1.1" 200 OK
When I test it with the code from the initial issue, I get the info message no matter if the collection exists or not. I guess the problem is someplace else. I will update this comment (or write a new one) if I find where the problem is.
Thank you for the fast replies and for your time!
from chroma.
Hey @hoosengold, thanks for pointing this out. This is just an info-level log message used for tracking the behavior of the get_or_create_collection()
function semantics. It just lets you know that the call did not create a new collection but returned an existing one. I can see how this exact phrasing can be misleading and interpreted as an error.
Let us improve on the messaging.
from chroma.
Hi @tazarov, thank you for the fast reply!
It just lets you know that the call did not create a new collection but returned an existing one.
It seems like the message is always displayed, not just when getting the collection but also when creating it. That means that the created
bool variable is always set to False
by the _sysdb.create_collection()
method for some reason. I hope that this does not indicate a more complex problem.
However, thanks again for the quick response and fixing the info message!
from chroma.
Thanks for this insight, @hoosengold. I will have a look in sysdb and fix that if necessary.
from chroma.
I just tested with:
import chromadb
client = chromadb.HttpClient()
client.get_or_create_collection("Test")
Results:
INFO: [15-05-2024 13:57:01] Application startup complete.
INFO: [15-05-2024 13:57:01] Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
INFO: [15-05-2024 13:57:09] ::1:50449 - "GET /api/v1/tenants/default_tenant HTTP/1.1" 200
INFO: [15-05-2024 13:57:09] ::1:50449 - "GET /api/v1/databases/default_database?tenant=default_tenant HTTP/1.1" 200
INFO: [15-05-2024 13:57:09] ::1:50450 - "POST /api/v1/collections?tenant=default_tenant&database=default_database HTTP/1.1" 200
INFO: [15-05-2024 13:57:17] ::1:50453 - "GET /api/v1/tenants/default_tenant HTTP/1.1" 200
INFO: [15-05-2024 13:57:17] ::1:50453 - "GET /api/v1/databases/default_database?tenant=default_tenant HTTP/1.1" 200
DEBUG: [15-05-2024 13:57:17] Collection Test already exists, returning existing collection.
INFO: [15-05-2024 13:57:17] ::1:50454 - "POST /api/v1/collections?tenant=default_tenant&database=default_database HTTP/1.1" 200
As expected, the message was returned only when trying to get_or_create_collection()
on an existing collection. The initial creation (INFO: [15-05-2024 13:57:09] ::1:50450 - "POST /api/v1/collections?tenant=default_tenant&database=default_database HTTP/1.1" 200
) of the collection did not trigger the message.
from chroma.
Closing this for bug hygiene. Feel free to create another issue if you find another issue.
from chroma.
Related Issues (20)
- [Install issue]: type object 'CreateCollection' has no attribute 'model_validate' during Create Index HOT 3
- [Feature Request]: TTL for entries HOT 1
- [Bug]: Upserting the same data causes the SQLite db to grow by 50-100% HOT 3
- [Bug]: sqlite3.OperationalError: no such column: collections.topic HOT 7
- [Install issue]: Use my own embedding function add data error HOT 3
- No OllamaEmbeddingFunction in latest release of chromadb/npm module HOT 5
- [BLD]: Matrix test for Node 16+
- [Feature Request]: Langchain plugin for Chroma always tries to create the collection even if the collection already exists. HOT 13
- [Feature Request]: Issue with Data Structure in Chroma DB Collections HOT 2
- [Bug]: Missing OllamaEmbeddingFunction when using chromadb==0.5.0 HOT 2
- [Feature Request]: Set ef_search per query HOT 3
- [Feature Request]: Bump black to 24.4.2
- [Bug]: "Cannot submit more than 5,461 embeddings at once. Please submit your embeddings in batches of size 5,461 or less." but on running *.delete* HOT 5
- [Feature Request]: Async.io suport for python HOT 1
- [Feature Request]: Docs to be crawler friendly, and LLM discoverable HOT 2
- [Bug]: client/server mode RuntimeError: coroutine raised StopIteration HOT 6
- [Bug]: Type mismatch for embedding function HOT 6
- [Bug]: where not equals clause not working HOT 2
- [Install issue]: Packaging and Deployment Issue with chromadb-client in AWS Lambda HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chroma.