Traceback (most recent call last): File…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1967, in _get_module return importlib.import_module("." + module_name, self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/dist-packages/transformers/generation/utils.py", line 30, in from transformers.generation.candidate_generator import AssistantVocabTranslatorCache File "/usr/local/lib/python3.11/dist-packages/transformers/generation/candidate_generator.py", line 27, in from sklearn.metrics import roc_curve File "/usr/local/lib/python3.11/dist-packages/sklearn/init.py", line 82, in from .base import clone File "/usr/local/lib/python3.11/dist-packages/sklearn/base.py", line 17, in from .utils import _IS_32BIT File "/usr/local/lib/python3.11/dist-packages/sklearn/utils/init.py", line 19, in from .murmurhash import murmurhash3_32 File "sklearn/utils/murmurhash.pyx", line 1, in init sklearn.utils.murmurhash ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1967, in _get_module return importlib.import_module("." + module_name, self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/dist-packages/transformers/models/auto/modeling_auto.py", line 21, in from .auto_factory import ( File "/usr/local/lib/python3.11/dist-packages/transformers/models/auto/auto_factory.py", line 40, in from ...generation import GenerationMixin File "", line 1229, in _handle_fromlist File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1955, in getattr module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1969, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.generation.utils because of the following error (look up to see its traceback): numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/bin/llamafactory-cli", line 5, in from llamafactory.cli import main File "/content/LLaMA-Factory/src/llamafactory/init.py", line 28, in from .extras.env import VERSION File "/content/LLaMA-Factory/src/llamafactory/extras/env.py", line 22, in import peft File "/usr/local/lib/python3.11/dist-packages/peft/init.py", line 17, in from .auto import ( File "/usr/local/lib/python3.11/dist-packages/peft/auto.py", line 21, in from transformers import ( File "", line 1229, in _handle_fromlist File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1956, in getattr value = getattr(module, name) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1955, in getattr module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py", line 1969, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.models.auto.modeling_auto because of the following error (look up to see its traceback): Failed to import transformers.generation.utils because of the following error (look up to see its traceback): numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
This error:
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
means your installed version of numpy is not compatible with your installed version of scikit-learn (or another C-extension library). This is a classic Python packaging issue, especially common after upgrading/downgrading numpy, or mixing pip and conda installs.
The safest way is to force-reinstall both numpy and scikit-learn so they are built against the same C-ABI.
pip install --upgrade --force-reinstall numpy scikit-learn
Or, if you use conda:
conda install numpy scikit-learn
Sometimes, multiple versions of numpy are installed in different locations. Check with:
python -c "import numpy; print(numpy.__file__)"
If you see something odd (e.g., in both /usr/local and /usr/lib), you may need to clean up your environment.
If you are developing or have built packages from source, remove all *.pyc files and __pycache__ folders:
find . -name "*.pyc" -delete
find . -name "__pycache__" -delete
After reinstalling, restart your Python kernel or shell to clear any cached modules.
If the above doesn't work, create a new virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install numpy scikit-learn transformers peft
If you still have issues, please provide the output of:
pip freeze | grep -E 'numpy|scikit-learn|transformers|peft'
and your Python version:
python --version
for more targeted help!