THUDM / ChatGLM3

ChatGLM3 series: Open Bilingual Chat LLMs | 开源双语对话语言模型
Apache License 2.0
13.39k stars 1.55k forks source link

导入huggingface_hub不知道那个版本导入库没有后面的 TextGenerationStreamResponse, Token #1218

Closed lq954359980 closed 4 months ago

lq954359980 commented 5 months ago

System Info / 系統信息

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Who can help? / 谁可以帮助到您?

File "C:\Users\61397\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script exec(code, module.dict) File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\main.py", line 10, in import demo_chat, demo_ci, demo_tool File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\demo_chat.py", line 4, in from client import get_client File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\client.py", line 9, in from huggingface_hub.inference._text_generation import TextGenerationStreamResponse, Token

Information / 问题信息

Reproduction / 复现过程

ModuleNotFoundError: No module named 'huggingface_hub.inference._text_generation' Traceback: File "C:\Users\61397\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script exec(code, module.dict) File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\main.py", line 10, in import demo_chat, demo_ci, demo_tool File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\demo_chat.py", line 4, in from client import get_client File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\client.py", line 9, in from huggingface_hub.inference._text_generation import TextGenerationStreamResponse, Token 不知道那个版本试了好几个都不行

Expected behavior / 期待表现

ModuleNotFoundError: No module named 'huggingface_hub.inference._text_generation' Traceback: File "C:\Users\61397\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script exec(code, module.dict) File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\main.py", line 10, in import demo_chat, demo_ci, demo_tool File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\demo_chat.py", line 4, in from client import get_client File "D:\workspace\LegalPyChatGLM\ChatGLM3\composite_demo\client.py", line 9, in from huggingface_hub.inference._text_generation import TextGenerationStreamResponse, Token 不知道那个版本试了好几个都不行

newlxj commented 5 months ago

pip install "huggingface_hub<0.22.0" pip install chardet

zRzRzRzRzRzRzR commented 5 months ago

用2.22.0之前,之后的代码会更新

withflyingfree commented 5 months ago

我也遇到了

dp9212 commented 4 months ago

安装huggingface_hub错误信息: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. transformers 4.41.0 requires huggingface-hub<1.0,>=0.23.0, but you have huggingface-hub 0.19.4 which is incompatible. Successfully installed huggingface_hub-0.19.4

模型启动报错: ImportError: huggingface-hub>=0.23.0,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.19.4. Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main

请问这个问题怎么解决呢? @zRzRzRzRzRzRzR

zRzRzRzRzRzRzR commented 4 months ago

降级版本,降级到 huggingface-hub==0.19.4 transformers 降级到4.40以下,最新的代码还有这个依赖问题吗

Arondight commented 4 months ago

降级版本,降级到 huggingface-hub==0.19.4 transformers 降级到4.40以下,最新的代码还有这个依赖问题吗

composite_demo 还是这样,别的没试

dp9212 commented 4 months ago

降级版本,降级到 huggingface-hub==0.19.4 transformers 降级到4.40以下,最新的代码还有这个依赖问题吗

ChatGLM3是从github拉取的最新代码,chatglm3-6b是从modelscope拉取的,basic_demo没有问题,openai_api_demo没有问题,composite_demo还是有上述问题,其他demo没有尝试。

最新代码的requirements.txt里面要求了transformers>=4.41.0,晚上我尝试下降级transformers。

感谢回复。 ChatGLM3是从github拉取的最新代码,chatglm3-6b是从modelscope拉取的,basic_demo没有问题,openai_api_demo没有问题,composite_demo还是有上述问题,其他demo没有尝试。

最新代码的requirements.txt里面要求了transformers>=4.41.0,晚上我尝试下降级transformers。

@zRzRzRzRzRzRzR 感谢回复。

zRzRzRzRzRzRzR commented 4 months ago

已经改了依赖,降级一下依赖吧

dfdr557 commented 4 months ago

transformers==4.40.0 huggingface-hub==0.20.2 这个也能跑起来composite_demo