josStorer/RWKV-Runner

因为ImportError: cannot import name 'packaging' from 'pkg_resources'导致模型转换失败

Builderbot2000 opened this issue · 2 comments

问题:运行时模型转换失败无法启动

使用模型:https://huggingface.co/a686d380/rwkv-5-h-world
*所有相关配置皆来自以上模型的使用教程

错误日志:
cannot import name 'packaging' from 'pkg_resources' (C:\Users\user\Documents\RWKV Runner\py310\Lib\site-packages\pkg_resources_init_.py)
Traceback (most recent call last):
File "C:\Users\user\Documents\RWKV Runner\backend-python\routes\config.py", line 73, in switch_model
RWKV(model=body.model, strategy=body.strategy, tokenizer=body.tokenizer),
File "C:\Users\user\Documents\RWKV Runner\backend-python\utils\rwkv.py", line 644, in RWKV
from rwkv_pip.model import (
File "C:\Users\user\Documents\RWKV Runner\backend-python\rwkv_pip\model.py", line 84, in
from torch.utils.cpp_extension import load
File "C:\Users\user\Documents\RWKV Runner\py310\Lib\site-packages\torch\utils\cpp_extension.py", line 25, in
from pkg_resources import packaging # type: ignore[attr-defined]
ImportError: cannot import name 'packaging' from 'pkg_resources' (C:\Users\user\Documents\RWKV Runner\py310\Lib\site-packages\pkg_resources_init_.py)
INFO: 127.0.0.1:1790 - "POST /switch-model HTTP/1.1" 500 Internal Server Error

可能原因:AUTOMATIC1111/stable-diffusion-webui#15863

可能解决方法:降级setuptools到70以下的版本

请问大佬如何在RWKV-Runner的自带环境中降级setuptools?

#342

./py310/python -m pip install setuptools==69.5.1

问题已解决,谢谢大佬。