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

Failed to import transformers.models.auto.modeling_auto because numpy.core.multiarray failed to import #36343

Open
4 tasks
forrestbao opened this issue Feb 22, 2025 · 1 comment
Labels

Comments

@forrestbao
Copy link

System Info

I am currently trying to import peft. But I got the following error:

Traceback (most recent call last):
  File "/home/paperspace/cache/ml/experiments/hhem2/hhem2/finetune/new_train.py", line 18, in <module>
    import peft
  File "/home/paperspace/.local/lib/python3.10/site-packages/peft/__init__.py", line 22, in <module>
    from .auto import (
  File "/home/paperspace/.local/lib/python3.10/site-packages/peft/auto.py", line 21, in <module>
    from transformers import (
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "/home/paperspace/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1852, in __getattr__
    value = getattr(module, name)
  File "/home/paperspace/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1851, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/home/paperspace/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1865, 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.core.multiarray failed to import

I have already upgraded transformers and numpy to the latest version.

numpy 2.2.3
transformers 4.49.0
peft 0.14.0

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

run the following command on ur Linux terminal:

python3 -c "import peft"

Expected behavior

Shouldn't see any error. Silence.

@forrestbao forrestbao added the bug label Feb 22, 2025
@Ajinkya-25
Copy link

Hello,
It worked on my machine without any error with same versions of numpy and peft. Maybe reinstalling libaries or downgrading will work.

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

No branches or pull requests

2 participants