Closed Pringled closed 2 hours ago
Hello, thank you for the detailed report.
This is typically due to a known issue between Faiss and macOS (https://github.com/kyamagu/faiss-wheels/issues/100)
The usual mitigations are:
Issue
Segmentation faults and similar errors on macOS
Solution
Set the following environment parameters.
Source: https://neuml.github.io/txtai/faq/
There is also this: https://github.com/kyamagu/faiss-wheels/issues/73#issuecomment-1913995571
export KMP_DUPLICATE_LIB_OK=TRUE
It would be great to have a programmatic solution as I'm sure there are plenty of macOS users that encounter this error and just move on to another library.
Hi @davidmezzetti, thanks for the detailed reply! The other backends indeed seem to work fine. I guess an alternative solution would be to have a different default for the index method (e.g. hnsw), but I guess that's not as nice as it would introduce more base dependencies for txtai. For now I'll just use a different backend as I would be using hnsw from faiss anyway, thanks!
In the past, I had setup.py conditionally install hnswlib for mac/windows and faiss for linux as the defaults. But that became confusing as the results were different based on the OS.
I've been hoping the upstream library would find a solution but I've been holding my breath for a while :smile:
Hi! When running one of the examples, I ran into an issue.
Issue
The following code crashes with a segfault error when
search
is called:Environment info
Running on MacOS, M3, python version=3.10.14. Venv: