-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Error("Please install chromadb as a dependency with, e.g. npm install -S chromadb
") but chromadb existed in node_modules in newer langchain since version 147
#2637
Comments
🤖 Hello, I understand that you're having an issue with the From the context provided, there are two similar issues that have been resolved in the past:
If these solutions do not resolve your issue, it might be helpful to check the following:
I hope this helps. Let me know if you have any other questions or if there's anything else I can do to assist you. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
bump, getting the same errors as well @jacoblee93 any idea? |
Will have a look today, thanks for the heads up! |
@jacoblee93 thx. Is there an ETA on when it can get fixed? Currently Flowise is in production with Chroma and can't use it 🫠 |
@jeffchuber am about to dig in but any idea what could have changed? We set our Chroma peer dep to |
@pooriaarab @NajamShehzad @HenryHengZJ @helxsz hard locking Chroma to
If you add a caret it'll automatically upgrade to 1.5.9, which is likely where something bad was introduced. @jeffchuber may have more insight. |
@jacoblee93 thx for the quick update. this is from the Chroma discord: Apparently, if you rhard lock and rollback to Chroma 1.5.6 it will work |
BUMP @jacoblee93 @jeffchuber i hard locked Chroma but get this error now: Chroma getOrCreateCollection error: Error: TypeError: fetch failed |
Maybe if you go to 1.5.8? |
Ideally, this would be fixed with chroma-core/chroma#1153 Tested with LC@0.0.150 also works with LC@0.0.147 (which I think is what latest flowise is using) |
I just released |
I confirmed with a minimal example that everything should be playing nice together - can folks give this a try? |
@jeffchuber issue still exists. @tazarov mentioned 1.5.11 version of Chroma can fix the dependency errors. |
Sounds like it fixed it! Thanks all for reporting - hopefully this doesn't happen again. |
I have latest flowise and chroma 1.5.11 and it still showing the same error... |
@jeffchuber any idea what's going on? |
FWIW |
@jacoblee93 hi, lee, I have tried your solution on
the issue of chromadb dependency is gone, but it seems I can't use the local transformer model as I did
the error is
looks like it always try to fetch the hub for the model. |
Doesn't look like you're using it through LangChain? We only support https://js.langchain.com/docs/modules/data_connection/text_embedding/integrations/transformers |
This is exact example I am testing right now.
langchain 0.0147 can use the local model whereas langchain 0.0.150 looking to fetch the model from huggerface hub |
1 similar comment
This is exact example I am testing right now.
langchain 0.0147 can use the local model whereas langchain 0.0.150 looking to fetch the model from huggerface hub |
This is still happening with langchain (^0.1.27) and chromadb (^1.8.1). Error: Please install chromadb as a dependency with, e.g. `npm install -S chromadb`
at t.imports (file:///X/Projects/js/ai/live-llm/dist/index.js:238:10239)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async t.ensureCollection (file:///X/Projects/js/ai/live-llm/dist/index.js:238:7908)
at async t.addVectors (file:///X/Projects/js/ai/live-llm/dist/index.js:238:8600)
at async t.fromDocuments (file:///X/Projects/js/ai/live-llm/dist/index.js:238:9990)
at async file:///X/Projects/js/ai/live-llm/dist/index.js:245:473 |
@bracesproul you were trying this recently weren't you? |
Can you give me a bit of information about your environment @ricardomatias? It looks like it might be something like Next.js? |
Hi All - I know this issue is closed, but I recently came across this problem in December 2024 and found a fix/work-around for it. I was experiencing this issue when using LangChain's Chroma libraries for unit tests with testcontainers. Changing my npm test command from:
to:
fixed the problem. Please note the Here is a working jest test suite that uses testcontainers to spin up a chromadb instance, and then the test uses both the LangChain chroma abstractions in addition to the ChromaClient directly provided by the chroma team. import { ChromaDBContainer, StartedChromaDBContainer } from '@testcontainers/chromadb';
import { ChromaClient, OllamaEmbeddingFunction } from 'chromadb';
import { OllamaEmbeddings } from '@langchain/ollama';
import { PDFLoader } from '@langchain/community/document_loaders/fs/pdf';
import { Chroma } from '@langchain/community/vectorstores/chroma';
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
jest.setTimeout(10000);
const CHROMA_IMAGE = 'chromadb/chroma:0.5.18';
describe('chroma', () => {
let chromaDbContainer: StartedChromaDBContainer | undefined = undefined;
let chroma: ChromaClient | undefined = undefined;
let chromaEmbeddingFunction: OllamaEmbeddingFunction | undefined = undefined;
beforeAll(async () => {
chromaDbContainer = await new ChromaDBContainer(CHROMA_IMAGE).start();
chroma = new ChromaClient({
path: `http://${chromaDbContainer.getHost()}:${chromaDbContainer.getMappedPort(8000)}`
});
chromaEmbeddingFunction = new OllamaEmbeddingFunction({
url: `http://localhost:11434/api/embeddings`,
model: 'nomic-embed-text'
});
});
afterAll(async () => {
if (chromaDbContainer) {
await chromaDbContainer.stop();
}
});
it('Just Works™', async () => {
const documentPath = path.normalize('test-data/sample.pdf');
const loader = new PDFLoader(documentPath, {
splitPages: true
});
const textSplitter = new RecursiveCharacterTextSplitter({
chunkSize: 300,
chunkOverlap: 50
});
const doc = await loader.load();
const splitDoc = await textSplitter.splitDocuments(doc);
const ollamaEmbeddings = new OllamaEmbeddings({
baseUrl: 'http://localhost:11434',
model: 'nomic-embed-text'
});
const collectionName = 'test-collection';
// ingest using the LangChain chroma abstraction
await Chroma.fromDocuments(splitDoc, ollamaEmbeddings, {
collectionName,
url: `http://${chromaDbContainer.getHost()}:${chromaDbContainer.getMappedPort(8000)}`
});
// retrieve using the native chroma client
const assistantCollection = await chroma.getCollection({ name: collectionName, embeddingFunction: chromaEmbeddingFunction });
const collectionContents = await assistantCollection.get();
expect(collectionContents.documents.length).toBe(93);
});
}); |
My previous code used to be working in 0.0.145,
now in newer version, 0.0.147, 0.0.148, 0.0.149(not tested yet but seems to be still wrong) are all getting an errors saying
however the node_modules has the latest chromadb 1.5.8 , even downgraded to 1.5.3, still output the same error for no reason, any ideas why chromadb package not found ?
The text was updated successfully, but these errors were encountered: