I'm encountering an ImportError when trying to run the gradio_app.py script. The error occurs specifically when importing cached_download from the huggingface_hub package. The full error message is as follows:
Traceback (most recent call last):
File "/workspace/Paints-UNDO/gradio_app.py", line 19, in <module>
from diffusers_helper.code_cond import unet_add_coded_conds
File "/workspace/Paints-UNDO/diffusers_helper/code_cond.py", line 3, in <module>
from diffusers.models.embeddings import TimestepEmbedding, Timesteps
File "/root/miniforge3/envs/paints_undo/lib/python3.10/site-packages/diffusers/__init__.py", line 5, in <module>
from .utils import (
File "/root/miniforge3/envs/paints_undo/lib/python3.10/site-packages/diffusers/utils/__init__.py", line 38, in <module>
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/root/miniforge3/envs/paints_undo/lib/python3.10/site-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in <module>
from huggingface_hub import cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/root/miniforge3/envs/paints_undo/lib/python3.10/site-packages/huggingface_hub/__init__.py)
Steps to Reproduce:
Set up the environment by following the project setup instructions.
Run the gradio_app.py script.
The error occurs when attempting to import cached_download from huggingface_hub.
Environment:
Python version: 3.10
OS: Ubuntu 20.04
Possible Cause:
It seems like the huggingface_hub package may have been updated or changed, resulting in the absence of cached_download. The API may have changed or the function might have been removed in the latest version.
Expected Behavior:
The script should run without any import errors. The cached_download function should be available for use within the huggingface_hub package.
Suggested Fix:
Check if the function cached_download has been removed or renamed in newer versions of huggingface_hub.
Verify the compatibility of huggingface_hub with other dependencies in the project.
Additional Notes:
I have already tried updating and reinstalling the huggingface_hub package, but the issue persists.
If the API has changed, it would be helpful to know the recommended alternative for the cached_download function.
I'm encountering an
ImportError
when trying to run thegradio_app.py
script. The error occurs specifically when importingcached_download
from thehuggingface_hub
package. The full error message is as follows:Steps to Reproduce:
gradio_app.py
script.cached_download
fromhuggingface_hub
.Environment:
Possible Cause: It seems like the
huggingface_hub
package may have been updated or changed, resulting in the absence ofcached_download
. The API may have changed or the function might have been removed in the latest version.Expected Behavior: The script should run without any import errors. The
cached_download
function should be available for use within thehuggingface_hub
package.Suggested Fix:
cached_download
has been removed or renamed in newer versions ofhuggingface_hub
.huggingface_hub
with other dependencies in the project.Additional Notes:
huggingface_hub
package, but the issue persists.cached_download
function.