chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
14.99k stars 1.26k forks source link

[Bug]: Failed to Deploy in HuggingFace Spaces #412

Closed shba007 closed 1 year ago

shba007 commented 1 year ago

What happened?

Running Correctly on Local Windows Machine but failed to deploy in Hugging Face spaces

Versions

Chromadb 0.3.21, Python 3.10.11

Relevant log output

WARNING:chromadb:Using embedded DuckDB without persistence: data will be transient
Traceback (most recent call last):
  File "/home/user/app/main.py", line 11, in <module>
    from routes.search import router as search_router
  File "/home/user/app/routes/search.py", line 24, in <module>
    chroma = Chroma.Client()
  File "/home/user/.local/lib/python3.10/site-packages/chromadb/__init__.py", line 83, in Client
    return chromadb.api.local.LocalAPI(settings, get_db(settings), telemetry_client)
  File "/home/user/.local/lib/python3.10/site-packages/chromadb/__init__.py", line 50, in get_db
    import chromadb.db.duckdb
  File "/home/user/.local/lib/python3.10/site-packages/chromadb/db/duckdb.py", line 12, in <module>
    import duckdb
ImportError: random_device could not be read
HammadB commented 1 year ago

These seems like a hugging face spaces issue. random_device is a c++ std lib https://en.cppreference.com/w/cpp/numeric/random/random_device that I assume is being used by duckdb. My guess is that the huggingface spaces env doesn't properly support it.

I would consult with the huggingface spaces folks on this issue. Closing this out for now, but feel free to reopen.

pseudotensor commented 1 year ago

@shba007 Did you find any resolution to this kind of issue?

I don't even get an error, just ends with:

Using embedded DuckDB with persistence: data will be stored in: db_dir_UserData

and says absolutely nothing more, but spaces complains about runtime error.

FYI @HammadB I'll have to stop using chroma if I can't figure this out.