THUDM / LongWriter

LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs
Apache License 2.0
1.02k stars 85 forks source link

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. #13

Closed Li-Fanda closed 4 weeks ago

Li-Fanda commented 4 weeks ago

System Info / 系統信息

linux系统 transformers == 4.43.0 torch == 2.4.0 python == 3.12.0

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

No response

Information / 问题信息

Reproduction / 复现过程

在conda环境中进入项目路径并进入搭好环境的虚拟环境,然后运行python trans_web_demo.py; 项目正常运行启动并输出Gradio网址,打开浏览器进入该网页; 在输入框中输入”你是谁?“,点击Submit,发现一直处于推理的过程,再查看conda窗口,发现报错如下:

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.

1322

Expected behavior / 期待表现

能够正常在Gradio网页中进行推理

bys0318 commented 4 weeks ago

请更新到最新的模型文件,主要是modeling_chatglm.py文件,也同时更新trans_web_demo.py文件

Li-Fanda commented 4 weeks ago

请更新到最新的模型文件,主要是modeling_chatglm.py文件,也同时更新trans_web_demo.py文件

非常感谢!已经推理成功,祝好!