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

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

Closed
2 tasks
lq954359980 opened this issue May 16, 2024 · 9 comments
Assignees

Comments

@lq954359980
Copy link

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 / 问题信息

  • The official example scripts / 官方的示例脚本
  • My own modified scripts / 我自己修改的脚本和任务

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
Copy link

newlxj commented May 17, 2024

pip install "huggingface_hub<0.22.0"
pip install chardet

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this May 19, 2024
@zRzRzRzRzRzRzR
Copy link
Member

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

@withflyingfree
Copy link

我也遇到了

@dp9212
Copy link

dp9212 commented May 25, 2024

安装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
Copy link
Member

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

@Arondight
Copy link

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

composite_demo 还是这样,别的没试

@dp9212
Copy link

dp9212 commented May 26, 2024

降级版本,降级到 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
Copy link
Member

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

@dfdr557
Copy link

dfdr557 commented Jun 9, 2024

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

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

7 participants