CTranslate2
CTranslate2 copied to clipboard
Importing `numpy` after `ctranslate2` causes segfault
On my computer (MacBook Pro 14", 2021 with M1 Pro, 16GB RAM, Ventura 13.3.1), this code causes python
to segfault:
import ctranslate2
import numpy as np
The fix is the following:
import numpy as np
import ctranslate2
I know that this usually doesn't happen, but on my machine it does.
I have the following packages installed (using pip
) (in a conda
environment):
Package Version
------------------ -----------
accelerate 0.18.0
aiohttp 3.8.4
aiosignal 1.3.1
async-timeout 4.0.2
attrs 22.2.0
bandit 1.7.5
certifi 2022.12.7
charset-normalizer 3.1.0
contourpy 1.0.7
ctranslate2 3.12.0
cycler 0.11.0
filelock 3.10.7
fonttools 4.39.3
frozenlist 1.3.3
gitdb 4.0.10
GitPython 3.1.31
huggingface-hub 0.13.3
idna 3.4
kiwisolver 1.4.4
markdown-it-py 2.2.0
matplotlib 3.7.1
mdurl 0.1.2
multidict 6.0.4
numpy 1.24.2
openai 0.27.2
packaging 23.0
pbr 5.11.1
peft 0.3.0.dev0
Pillow 9.5.0
pip 23.0.1
psutil 5.9.4
Pygments 2.14.0
pyparsing 3.0.9
python-dateutil 2.8.2
PyYAML 6.0
regex 2023.3.23
requests 2.28.2
rich 13.3.3
sentencepiece 0.1.98
setuptools 67.6.1
six 1.16.0
smmap 5.0.0
stevedore 5.0.0
tokenizers 0.13.2
torch 1.13.1
tqdm 4.65.0
transformers 4.28.0.dev0
typing_extensions 4.5.0
urllib3 1.26.15
wheel 0.40.0
yarl 1.8.2