Skip to content
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

38210 segmentation fault #463

Closed
Lionardo opened this issue Apr 19, 2023 · 3 comments
Closed

38210 segmentation fault #463

Lionardo opened this issue Apr 19, 2023 · 3 comments

Comments

@Lionardo
Copy link

Is there a way to fix this? I am asking here because I couldn't find any other source.

I am using the simple example and when I run this code I am getting the error:

38328 segmentation fault pipenv run python3 embedding.py

machine:
Monterey version: 12.6.3
MacBook Pro (14-inch, 2021)
chip Apple M1 Max

example code:

from txtai.embeddings import Embeddings
data = ["US tops 5 million confirmed virus cases",
        "Canada's last fully intact ice shelf has suddenly collapsed, forming a Manhattan-sized iceberg",
        "Beijing mobilises invasion craft along coast as Taiwan tensions escalate",
        "The National Park Service warns against sacrificing slower friends in a bear attack",
        "Maine man wins $1M from $25 lottery ticket",
        "Make huge profits without work, earn up to $100,000 a day"]

# Create embeddings index with content enabled. The default behavior is to only store indexed vectors.
embeddings = Embeddings({"path": "sentence-transformers/nli-mpnet-base-v2", "content": True})

# Create an index for the list of text
embeddings.index([(uid, text, None) for uid, text in enumerate(data)])

# Run a search
embeddings.search("feel good story", 1)
@davidmezzetti
Copy link
Member

Hi @Lionardo, thank you for posting the issue.

Unfortunately, I don't have a great solution on why the latest version of PyTorch have this issue on macOS. The current workarounds can be found in #377

@davidmezzetti
Copy link
Member

Closing this due to inactivity. #377 fixed a similar issue by setting the env variable OMP_NUM_THREADS=1

@avi-cenna
Copy link

A similar issue happened for me. I'm on an Intel Mac. Setting export OMP_NUM_THREADS=1 in ~/.zshrc fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants