ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.11/dist-packages/huggingface_hub/__init__.py)
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.11/dist-packages/huggingface_hub/init.py)
When running on colab. Can someone help please?
Downgrading huggingface_hub to 0.25.0 helped me resolve the issue.
Edit:forgot to say Thank!
!pip install huggingface_hub==0.25.2
/content/animatediff
Traceback (most recent call last):
File "
this is what i get. someone else here also postex same thing
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.11/dist-packages/huggingface_hub/init.py)
When running on colab. Can someone help please?
Same error here. I'm using uv for runtime management. Here's my pyproject.toml (downgrading to 0.25.0 worked!).
[project]
name = "animatediff"
version = "0.1.0"
description = "animatediff"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"decord==0.6.0",
"diffusers==0.11.1",
"einops>=0.8.1",
"gradio==3.36.1",
"huggingface-hub==0.25.0",
"imageio==2.27.0",
"imageio-ffmpeg==0.4.9",
"omegaconf==2.3.0",
"safetensors>=0.5.3",
"torch==2.3.1",
"torchvision==0.18.1",
"transformers==4.25.1",
"wandb>=0.19.11",
"xformers==0.0.27",
]
remove the import cached_download from this path diffusers/init/.pipeline_utils/.dynamic_modules_utils in this file it have import cached_download and have not used in anywhere
transformers==4.36.2 diffusers==0.25.0 accelerate==0.27.2 torch==2.1.2 huggingface_hub==0.16.4 opencv-python gradio==4.15.0 imageio imageio-ffmpeg
import gradio as gr from diffusers import AnimateDiffPipeline import torch
Charger le pipeline (change le modèle si nécessaire)
pipe = AnimateDiffPipeline.from_pretrained( "guoyww/AnimateDiff", torch_dtype=torch.float16 ).to("cuda")
Fonction de génération d'animation
def generate(prompt): video = pipe(prompt).frames return video
Interface Gradio
demo = gr.Interface( fn=generate, inputs=gr.Textbox(label="Texte d'entrée"), outputs=gr.Video(label="Vidéo générée"), title="AnimateDiff" )
demo.launch()