You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use peft in our project and yesterday tests started to fail in our CI with an error like:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/peft/peft_model.py:35: in <module>
from transformers.pytorch_utils import id_tensor_storage
E ImportError: cannot import name 'id_tensor_storage' from 'transformers.pytorch_utils' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/transformers/pytorch_utils.py)
In my project's requirements.txt, we have a pinned version transformers==4.28.1. Because peft does not specify transformers version, pip is fine to install peft==0.6.1 and transformers==4.28.1, although it raises an ImportError in runtime later.
Possible solution: explicitly set transformers>=0.6.1 in setup.py.
An officially supported task in the examples folder
My own task or dataset (give details below)
Reproduction
conda create -n peft-reproduce python=3.10
conda activaate peft-reproduce
pip install transformers==4.28.1 peft==0.6.1
python
>>> import peft
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/anaconda3/envs/peft-reproduce/lib/python3.10/site-packages/peft/__init__.py", line 22, in <module>
from .auto import (
File "/opt/homebrew/anaconda3/envs/peft-reproduce/lib/python3.10/site-packages/peft/auto.py", line 31, in <module>
from .mapping import MODEL_TYPE_TO_PEFT_MODEL_MAPPING
File "/opt/homebrew/anaconda3/envs/peft-reproduce/lib/python3.10/site-packages/peft/mapping.py", line 23, in <module>
from .peft_model import (
File "/opt/homebrew/anaconda3/envs/peft-reproduce/lib/python3.10/site-packages/peft/peft_model.py", line 35, in <module>
from transformers.pytorch_utils import id_tensor_storage
ImportError: cannot import name 'id_tensor_storage' from 'transformers.pytorch_utils' (/opt/homebrew/anaconda3/envs/peft-reproduce/lib/python3.10/site-packages/transformers/pytorch_utils.py)
### Expected behavior
`pip install` should fail if `transformers<4.30.0`
The text was updated successfully, but these errors were encountered:
PEFT will typically be installed in conjunction with many other libraries, each with their own dependencies. If those are too restrictive when it comes to versions, it will be impossible to resolve the environment. Therefore, we strive to put as few limitations as possible on the requirements. If you are aware of anything else breaking with older transformers versions, please let us know.
System Info
Hi peft community,
We use
peft
in our project and yesterday tests started to fail in our CI with an error like:Line
from transformers.pytorch_utils import id_tensor_storage
was added in peft==0.6.1 as a part of this PR by @younesbelkada: https://github.com/huggingface/peft/pull/1101/files#diff-95787fcc5356568929e383449ade2c1bac5da43deccab17318652b62ed171ae7R35Function
id_tensor_storage
was added totransformers
in version 4.30.0: huggingface/transformers@d68d666So, it is required to have at least
transformers==4.30.0
to usepeft==0.6.1.
.At the same time,
peft
does not set any version limits fortransformers
package: https://github.com/huggingface/peft/blob/main/setup.py#L46C10-L46C22In my project's
requirements.txt
, we have a pinned versiontransformers==4.28.1
. Becausepeft
does not specifytransformers
version, pip is fine to installpeft==0.6.1
andtransformers==4.28.1
, although it raises an ImportError in runtime later.Possible solution: explicitly set
transformers>=0.6.1
insetup.py
.Who can help?
@younesbelkada
Information
Tasks
examples
folderReproduction
The text was updated successfully, but these errors were encountered: