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 'OffloadedCache' from 'transformers.cache_utils' #18

Open
xueqing0622 opened this issue Nov 5, 2024 · 2 comments

Comments

@xueqing0622
Copy link

Traceback (most recent call last):
File "F:\ComfyUI\ComfyUI\nodes.py", line 2012, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\ComfyUI\ComfyUI\custom_nodes\OmniGen-ComfyUI_init
.py", line 17, in
from OmniGen import OmniGenPipeline
File "F:\ComfyUI\ComfyUI\custom_nodes\OmniGen-ComfyUI\OmniGen_init_.py", line 3, in
from .scheduler import OmniGenScheduler
File "F:\ComfyUI\ComfyUI\custom_nodes\OmniGen-ComfyUI\OmniGen\scheduler.py", line 6, in
from transformers.cache_utils import Cache, DynamicCache, OffloadedCache
ImportError: cannot import name 'OffloadedCache' from 'transformers.cache_utils' (F:\ComfyUI\python_embeded\Lib\site-packages\transformers\cache_utils.py)

Cannot import F:\ComfyUI\ComfyUI\custom_nodes\OmniGen-ComfyUI module for custom nodes: cannot import name 'OffloadedCache' from 'transformers.cache_utils' (F:\ComfyUI\python_embeded\Lib\site-packages\transformers\cache_utils.py)

@Dan0627
Copy link

Dan0627 commented Nov 5, 2024

一样的问题,这个要怎么解决呀

@xueqing0622 xueqing0622 changed the title mportError: cannot import name 'OffloadedCache' from 'transformers.cache_utils' ImportError: cannot import name 'OffloadedCache' from 'transformers.cache_utils' Nov 5, 2024
@TheLocalLab
Copy link

Upgrade your comfyui transformers library to the latest version. Run .\python_embeded\python.exe -m pip install --upgrade transformers in the directory containing the python_embeded folder if your running the portable version or just pip install --upgrade transformers if you installed comfy with your own python package.

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

3 participants