josStorer / RWKV-Runner

A RWKV management and startup tool, full automation, only 8MB. And provides an interface compatible with the OpenAI API. RWKV is a large language model that is fully open source and available for commercial use.
https://www.rwkv.com
MIT License
5.19k stars 491 forks source link

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

Closed Builderbot2000 closed 5 months ago

Builderbot2000 commented 5 months ago

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

使用模型: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

可能原因:https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/15863

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

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

josStorer commented 5 months ago

https://github.com/josStorer/RWKV-Runner/issues/342

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

Builderbot2000 commented 5 months ago

问题已解决,谢谢大佬。