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

ImportError: cannot import name 'Cache' from 'transformers' pert version error #119

Open
dhyuk54 opened this issue Jan 6, 2025 · 1 comment

Comments

@dhyuk54
Copy link

dhyuk54 commented Jan 6, 2025

In the project's requirements.txt/environment.yaml, the PEFT version was unspecified, causing an ImportError: "cannot import name 'Cache' from 'transformers'".
The error was resolved by specifying PEFT version:
**peft == 0.14.0 NG-------> pip install peft==0.12.0 OK **
huggingface-hub == 0.27.1 NG-------> pip install huggingface-hub==0.25.0 OK
ImportError: cannot import name 'cached_download' from 'huggingface_hub'

``
Package Version


accelerate 1.2.1
aiofiles 23.2.1
altair 5.5.0
annotated-types 0.7.0
anyio 4.8.0
attrs 24.3.0
blinker 1.9.0
cachetools 5.5.0
certifi 2024.12.14
charset-normalizer 3.4.1
clean-fid 0.1.35
click 8.1.8
clip 1.0
cmake 3.31.2
contourpy 1.3.1
cycler 0.12.1
diffusers 0.25.1
dominate 2.9.1
einops 0.8.0
exceptiongroup 1.2.2
fastapi 0.115.6
ffmpy 0.5.0
filelock 3.16.1
fonttools 4.55.3
fsspec 2024.12.0
ftfy 6.3.1
gitdb 4.0.12
GitPython 3.1.44
gradio 3.43.1
gradio_client 0.5.0
h11 0.14.0
httpcore 1.0.7
httpx 0.28.1
huggingface-hub 0.25.0
idna 3.10
importlib_metadata 8.5.0
importlib_resources 6.5.2
Jinja2 3.1.5
jsonschema 4.23.0
jsonschema-specifications 2024.10.1
kiwisolver 1.4.8
lightning-utilities 0.11.9
lit 18.1.8
lpips 0.1.4
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.10.0
mdurl 0.1.2
mpmath 1.3.0
narwhals 1.21.0
networkx 3.4.2
numpy 1.26.4
nvidia-cublas-cu11 11.10.3.66
nvidia-cuda-cupti-cu11 11.7.101
nvidia-cuda-nvrtc-cu11 11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11 8.5.0.96
nvidia-cufft-cu11 10.9.0.58
nvidia-curand-cu11 10.2.10.91
nvidia-cusolver-cu11 11.4.0.1
nvidia-cusparse-cu11 11.7.4.91
nvidia-nccl-cu11 2.14.3
nvidia-nvtx-cu11 11.7.91
open_clip_torch 2.30.0
opencv-python 4.6.0.66
orjson 3.10.13
packaging 24.2
pandas 2.2.3
peft 0.12.0
pillow 10.4.0
pip 24.2
protobuf 5.29.2
psutil 6.1.1
pyarrow 18.1.0
pydantic 2.10.4
pydantic_core 2.27.2
pydeck 0.9.1
pydub 0.25.1
Pygments 2.19.0
pyparsing 3.2.1
python-dateutil 2.9.0.post0
python-multipart 0.0.20
pytz 2024.2
PyYAML 6.0.2
referencing 0.35.1
regex 2024.11.6
requests 2.32.3
rich 13.9.4
rpds-py 0.22.3
safetensors 0.5.0
scipy 1.11.1
semantic-version 2.10.0
setuptools 75.1.0
six 1.17.0
smmap 5.0.2
sniffio 1.3.1
starlette 0.41.3
streamlit 1.41.1
streamlit-keyup 0.2.0
sympy 1.13.3
tenacity 9.0.0
timm 1.0.12
tokenizers 0.15.2
toml 0.10.2
torch 2.0.1
torchaudio 2.0.2
torchdata 0.6.1
torchmetrics 1.6.1
torchvision 0.15.2
tornado 6.4.2
tqdm 4.67.1
transformers 4.35.2
triton 2.0.0
typing_extensions 4.12.2
tzdata 2024.2
urllib3 1.26.20
uvicorn 0.34.0
watchdog 6.0.0
wcwidth 0.2.13
websockets 11.0.3
wheel 0.44.0
xformers 0.0.22
zipp 3.21.0

python src/inference_paired.py --model_name "edge_to_image" \
    --input_image "assets/examples/bird.png" \
    --prompt "a blue bird" \
    --output_dir "outputs"
@loaringlyc
Copy link

loaringlyc commented Jan 8, 2025

Thanks for your help! I got same problem, and by using:

  1. pip install peft==0.12.0
  2. pip install huggingface-hub==0.25.0

the problem is solved!

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

2 participants