TypeError: ChatGLM4Tokenizer._pad() got an unexpected keyword argument 'padding_side'

#21
by devops724 - opened

when i run example usage in info page i got this
glm-4-9b-1m-transformers.py", line 13, in
inputs = tokenizer.apply_chat_template([{"role": "user", "content": query}],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 1710, in apply_chat_template
out = self(
^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 2868, in call
encodings = self._call_one(text=text, text_pair=text_pair, **all_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 2978, in _call_one
return self.encode_plus(
^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 3054, in encode_plus
return self._encode_plus(
^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils.py", line 804, in _encode_plus
return self.prepare_for_model(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 3550, in prepare_for_model
encoded_inputs = self.pad(
^^^^^^^^^
File "/home/user/miniconda3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 3352, in pad
encoded_inputs = self._pad(
^^^^^^^^^^
TypeError: ChatGLM4Tokenizer._pad() got an unexpected keyword argument 'padding_side'

requirements.txt
torch==2.5.1
transformers==4.48.0

Sign up or log in to comment