[GH-ISSUE #5951] chromadb not working adding collection #65754

Closed
opened 2026-05-03 22:33:02 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @dominicdev on GitHub (Jul 25, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5951

What is the issue?

I'm trying to test the sample in getting Generate embeddings , but the chromadb seems adding collection not working

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

ollama version is 0.1.48

Originally created by @dominicdev on GitHub (Jul 25, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5951 ### What is the issue? I'm trying to test the sample in getting [Generate embeddings](https://ollama.com/blog/embedding-models) , but the chromadb seems adding collection not working ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version ollama version is 0.1.48
GiteaMirror added the bug label 2026-05-03 22:33:02 -05:00
Author
Owner

@rick-github commented on GitHub (Jul 25, 2024):

Ollama logs, application logs, sample code, examples of failures will make it easier to diagnose the problem.

<!-- gh-comment-id:2250425614 --> @rick-github commented on GitHub (Jul 25, 2024): Ollama logs, application logs, sample code, examples of failures will make it easier to diagnose the problem.
Author
Owner

@dominicdev commented on GitHub (Jul 29, 2024):

Ollama logs, application logs, sample code, examples of failures will make it easier to diagnose the problem.

that the problem there is not log or any I tried only the sample code this code, it will not finish the loop

`import ollama
import chromadb

documents = [
"Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels",
"Llamas were first domesticated and used as pack animals 4,000 to 5,000 years ago in the Peruvian highlands",
"Llamas can grow as much as 6 feet tall though the average llama between 5 feet 6 inches and 5 feet 9 inches tall",
"Llamas weigh between 280 and 450 pounds and can carry 25 to 30 percent of their body weight",
"Llamas are vegetarians and have very efficient digestive systems",
"Llamas live to be about 20 years old, though some only live for 15 years and others live to be 30 years old",
]

client = chromadb.Client()
collection = client.create_collection(name="docs")

for i, d in enumerate(documents):
response = ollama.embeddings(model="mxbai-embed-large", prompt=d)
embedding = response["embedding"]
collection.add(
ids=[str(i)],
embeddings=[embedding],
documents=[d]
)`

<!-- gh-comment-id:2254827388 --> @dominicdev commented on GitHub (Jul 29, 2024): > Ollama logs, application logs, sample code, examples of failures will make it easier to diagnose the problem. that the problem there is not log or any I tried only the sample code this code, it will not finish the loop `import ollama import chromadb documents = [ "Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels", "Llamas were first domesticated and used as pack animals 4,000 to 5,000 years ago in the Peruvian highlands", "Llamas can grow as much as 6 feet tall though the average llama between 5 feet 6 inches and 5 feet 9 inches tall", "Llamas weigh between 280 and 450 pounds and can carry 25 to 30 percent of their body weight", "Llamas are vegetarians and have very efficient digestive systems", "Llamas live to be about 20 years old, though some only live for 15 years and others live to be 30 years old", ] client = chromadb.Client() collection = client.create_collection(name="docs") for i, d in enumerate(documents): response = ollama.embeddings(model="mxbai-embed-large", prompt=d) embedding = response["embedding"] collection.add( ids=[str(i)], embeddings=[embedding], documents=[d] )`
Author
Owner

@d-kleine commented on GitHub (Aug 3, 2024):

It would have been helpful if you would have posted the error message as well.

Just tested, it works for me. You need to start Ollama desktop client on Windows and pull the model mxbai-embed-large with ollama pull mxbai-embed-large, and then execute the script

<!-- gh-comment-id:2266689263 --> @d-kleine commented on GitHub (Aug 3, 2024): It would have been helpful if you would have posted the error message as well. Just tested, it works for me. You need to start Ollama desktop client on Windows and pull the model `mxbai-embed-large` with `ollama pull mxbai-embed-large`, and then execute the script
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65754