HarderThenHarder / transformers_tasks

⭐️ NLP Algorithms with transformers lib. Supporting Text-Classification, Text-Generation, Information-Extraction, Text-Matching, RLHF, SFT etc.
https://www.zhihu.com/column/c_1451236880973426688
2.11k stars 376 forks source link

chatglm做finetune的时候报错 #40

Open tianmala opened 1 year ago

tianmala commented 1 year ago

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/mo/chatglm/transformers_tasks/LLM/finetune/train.py:352 in │ │ │ │ 349 │ │ 350 │ │ 351 if name == "main": │ │ ❱ 352 │ main() │ │ 353 │ │ │ │ /home/mo/chatglm/transformers_tasks/LLM/finetune/train.py:230 in main │ │ │ │ 227 │ │ model = model.quantize(args.quantization_bit) │ │ 228 │ │ │ 229 │ model = model.half() │ │ ❱ 230 │ model.gradient_checkpointing_enable() │ │ 231 │ model.enable_input_require_grads() │ │ 232 │ model.is_parallelizable = True │ │ 233 │ model.model_parallel = True │ │ │ │ /home/mo/miniconda3/envs/llm_env/lib/python3.8/site-packages/transformers/modeling_utils.py:1584 │ │ in gradient_checkpointing_enable │ │ │ │ 1581 │ │ activations". │ │ 1582 │ │ """ │ │ 1583 │ │ if not self.supports_gradient_checkpointing: │ │ ❱ 1584 │ │ │ raise ValueError(f"{self.class.name} does not support gradient check │ │ 1585 │ │ self.apply(partial(self._set_gradient_checkpointing, value=True)) │ │ 1586 │ │ │ 1587 │ def gradient_checkpointing_disable(self): │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValueError: ChatGLMForConditionalGeneration does not support gradient checkpointing.