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

GLM-4v-9b运行报错:TypeError: ChatGLM4Tokenizer._pad() got an unexpected keyword argument 'padding_side' #578

Open
1 of 2 tasks
tw-repository opened this issue Oct 7, 2024 · 1 comment

Comments

@tw-repository
Copy link

System Info / 系統信息

所有硬件条件正确,环境正确。因为所有代码、环境、设备等都未改动,在一个月前能够是能够正常运行的。而现在无法正常运行,不知道问题出在哪里。

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

No response

Information / 问题信息

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

Reproduction / 复现过程

输入图像
输入问题
报错:
Traceback (most recent call last):
File "/mnt/disk/tw_data/train/GLM-4-main/basic_demo/trans_cli_vision_demo.py", line 92, in
model_inputs = tokenizer.apply_chat_template(
File "/root/.cache/huggingface/modules/transformers_modules/glm-4v-9b/tokenization_chatglm.py", line 251, in apply_chat_template
output = self.batch_encode_plus(
File "/home/sa/anaconda3/envs/glm4v/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 3306, in batch_encode_plus
return self._batch_encode_plus(
File "/home/sa/anaconda3/envs/glm4v/lib/python3.10/site-packages/transformers/tokenization_utils.py", line 889, in _batch_encode_plus
batch_outputs = self._batch_prepare_for_model(
File "/home/sa/anaconda3/envs/glm4v/lib/python3.10/site-packages/transformers/tokenization_utils.py", line 967, in _batch_prepare_for_model
batch_outputs = self.pad(
File "/home/sa/anaconda3/envs/glm4v/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 3522, in pad
outputs = self._pad(
TypeError: ChatGLM4Tokenizer._pad() got an unexpected keyword argument 'padding_side'

Process finished with exit code 1

Expected behavior / 期待表现

修正错误后,正常运行。

@IntelligentSynthesis
Copy link

IntelligentSynthesis commented Oct 8, 2024

参考 https://huggingface.co/THUDM/LongWriter-glm4-9b/commit/778b5712634889f5123d6c463ca383bc6dd5c621
在def _pad这里修改即可解决。

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

2 participants