Chroma.from_documents Segmentation Fault #16622
Replies: 3 comments 1 reply
-
🤖 Hello again @MaximeCarriere! Good to see you back. It appears you've encountered a new challenge with LangChain. Let's see what we can do about it. The Regarding the segmentation fault you're experiencing, it's hard to pinpoint the exact cause without more information. However, the caution you mentioned from the Chroma documentation suggests that having multiple clients accessing the same path at the same time can cause issues. In your case, it seems like you're creating a new Chroma instance for each website in your loop. If these instances are trying to access the same persist directory at the same time, that could potentially cause a segmentation fault. One possible solution could be to create a single Chroma instance outside of your loop and add documents to it within the loop. This way, you're not creating multiple instances that could potentially conflict with each other. Here's an example of how you might do this: vectorstore = Chroma(embedding=GPT4AllEmbeddings(), persist_directory="./chroma_data/")
for i in df["websites"]:
try:
data = loader(i)
all_splits = splitter(data)
vectorstore.add_documents(documents=all_splits, ids=[i]*len(all_splits))
# rest of your code
except:
print(i + " not working") In this example, Please note that this is just a suggestion based on the information available. If this doesn't solve your issue, could you please provide more details about the segmentation fault? For example, the exact error message and the point in your code where it occurs would be helpful. SourcesThis 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. |
Beta Was this translation helpful? Give feedback.
-
Hi there, it comes to me the same question segmentation defalut. After my check, when i run this line of python code, it will hint me 'Segmentation fault'. |
Beta Was this translation helpful? Give feedback.
-
For more details, terminal session executing it occurs in following packages : tqdm , posthog, and chromadb |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I am a new user of Chroma and I have some difficulties concerning Chroma.from_documents.
I have a simple code running.
It works quite well but after a couple of iteration I got a segmentaion fault.
I saw this in the documentation of Chroma:
However I am not quite sure what is wrong? Should I not use the Chroma.from_documents this way? Should I create first a collection of all documents and then ask in the for loop to check specifically to certain documents? Any other recommandations?
Thank you for your help !
System Info
langchain==0.1.0
langchain-community==0.0.12
langchain-core==0.1.10
Beta Was this translation helpful? Give feedback.
All reactions