Comments (3)
@marichkazb, thanks for reaching out. Let me start by saying that your approach to Lambda is correct and is how many Chroma users are deploying/using Chroma in AWS.
Your original error does not seem to be an actual Chroma issue. From the trace, it appears to be related to pydantic models in the OpenAI package.
Regarding the second error, this appears to be some library version conflicts, which is a frequent thing in the fast-moving GenAI ecosystem. What are your system dependencies e.g. packages you have installed - chromadb-client
and openai
library alone?
Regarding your more specific question on the AWS Lambda. While I'll admit I am not expert in AWS stack, my personal preference would be a docker image over zipped dependencies. Have a look here for an example (https://github.com/erenyasarkurt/OpenAI-AWS-Lambda-Layer/blob/main/build/build.sh).
I understand that you can easily bake a docker image, upload it to ECR, and use it as the basis for your Lambda. If you're interested, I'll happily provide you with a more detailed example.
from chroma.
Note: also getting the following message when trying to install chromadb-client in the linux env. although when installing those manually, system responds that the requirement is already satisfied
pip3 install -t ./python/ chromadb-client
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. botocore 1.34.61 requires urllib3<1.27,>=1.25.4; python_version < "3.10", but you have urllib3 2.2.1 which is incompatible. aws-sam-cli 1.112.0 requires requests~=2.31.0, but you have requests 2.32.1 which is incompatible.
from chroma.
@tazarov thank you for your time!! I’ve created a docker image and currently use it as a basis for the Lambda function, it indeed resolved all dependency conflicts, thank you! 🙌🏻
Also, I was wondering if chroma uses any temporary files when quering the collection?
I’m using the following function get_results
to get the context for the system prompt for openAI. Although it seems like within the scope of this function it attempts to write files, resulting in an error: "error": "[Errno 30] Read-only file system: '/home/sbx_user1051’”. On AWS only /tmp folder is a writable directory, so any other attempt fails.
I tried setting the home environment to /tmp in the Dockerfile using ENV HOME=/tmp, but it didn’t help. If you have any ideas on how to possibly fix this, I'd really appreciate it!
def get_results(message):
chroma_client = chromadb.HttpClient(host='11.11.111.11’, port=8000)
from chromadb.utils.embedding_functions import SentenceTransformerEmbeddingFunction
embedding_function = SentenceTransformerEmbeddingFunction()
chroma_collection = chroma_client.get_collection("knowledge", embedding_function=embedding_function)
results = chroma_collection.query(query_texts=[message], n_results=5)
retrieved_documents = results['documents'][0]
concatenated_string = ""
for document in retrieved_documents:
concatenated_string += str(document)
return concatenated_string
from chroma.
Related Issues (20)
- [Feature Request]: Retrieve A List Of Metadata Or Collections
- [Bug]: Error when loading chromadb collection froma docker container HOT 4
- [ENH] Client / Server versioning compatibility HOT 1
- [Install issue]: Authentication token not applied when using docker HOT 2
- [Feature Request]: AUR package
- [Bug]: 100% appear, windows11, python 3.11.9, the error will appear when 100th data insert to collection HOT 2
- [Bug]: System cache not cleared when a new database is loaded with same persitent_directory HOT 2
- '"chromadb"' has no exported member named 'OllamaEmbeddingFunction'[Bug]: HOT 1
- [Bug]: Docker compose chroma fail to build due to numpy 2.0 HOT 2
- ChromadB alters the order of metadata text compared to original HOT 3
- [Bug]: RuntimeError: Not enough memory: loadIndex failed to allocate linklist from Chroma HOT 1
- [Bug]: Version 0.5.4 does not work on local VS code HOT 3
- [Bug]: Error executing model: Error computing NN outputs. HOT 3
- [Feature Request]: is there a plan to support batch processing in OpenCLIPEmbeddingFunction?
- Chroma is running in http-only client mode, and can only be run with 'chromadb.api.fastapi.FastAPI' as the chroma_api_impl HOT 3
- [Bug]: Collection.delete raises Exception instead of ValueError HOT 1
- [Bug]: Error chroma with protobuf HOT 2
- [Bug]: chromadb.api.configuration.InvalidConfigurationError: batch_size must be less than or equal to sync_threshold HOT 7
- [Install issue]: Conflict in dependencies between chromadb and pydantic Basesettings HOT 2
- [Feature Request]: Add functionality for dimension size parameter in embedding_functions.OpenAIEmbeddingFunction() as introduced by OPENAI for new embedding models HOT 6
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.