GLM-4
GLM-4 copied to clipboard
干净环境运行 trans_cli_demo.py 产生报错 TypeError: _pad() got an unexpected keyword argument 'padding_side'
System Info / 系統信息
python=3.9 CUDA Version: 12.4 GPU:4090 24G
新建的干净环境使用 pip install -r requirements.txt 安装的环境。安装版本与 requirements 相同
Who can help? / 谁可以帮助到您?
@wwewwt @cenyk1230
Information / 问题信息
- [X] The official example scripts / 官方的示例脚本
- [ ] My own modified scripts / 我自己修改的脚本和任务
Reproduction / 复现过程
$ python /home/ljh/git/GLM-4/basic_demo/trans_cli_demo.py Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00, 8.43it/s] Some parameters are on the meta device because they were offloaded to the cpu. Welcome to the GLM-4-9B CLI chat. Type your messages below.
You: 你好
Traceback (most recent call last):
File "/home/ljh/git/GLM-4/basic_demo/trans_cli_demo.py", line 82, in
尝试降低版本为 transformers==4.44.2
可以正常回答,但是有警告信息(The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask
to obtain reliable results.),且响应十分缓慢。
Welcome to the GLM-4-9B CLI chat. Type your messages below.
You: 你好
GLM-4:The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask
to obtain reliable results.
您好👋!我是人工智能助手,很高兴为您服务。有什么可以帮助您的吗?
Expected behavior / 期待表现
麻烦更新修改后的代码~~~