ChatGLM2-6B icon indicating copy to clipboard operation
ChatGLM2-6B copied to clipboard

[BUG/Help] <title>AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute 'lm_head'

Open dongteng opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

使用chatglm_Tuning中的方式 将lora与chatglm2相结合 但是报错 AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute 'lm_head' 在chatglm_Tuning中,对lm_head 做出如下处理: model.lm_head = CastOutputToFloat(model.lm_head)

Expected Behavior

No response

Steps To Reproduce

``

Environment

- OS:
- Python:3.8.17 
- Transformers:4.30.2
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

dongteng avatar Jul 28 '23 03:07 dongteng

same problem

Sun0308 avatar Sep 19 '23 06:09 Sun0308

same problem

snow00726 avatar Nov 09 '23 06:11 snow00726

same problem

+1

fouyhk avatar Nov 20 '23 10:11 fouyhk

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

使用chatglm_Tuning中的方式 将lora与chatglm2相结合 但是报错 AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute 'lm_head' 在chatglm_Tuning中,对lm_head 做出如下处理: model.lm_head = CastOutputToFloat(model.lm_head)

Expected Behavior

No response

Steps To Reproduce

``

Environment

- OS:
- Python:3.8.17 
- Transformers:4.30.2
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

How to solve this problem

fouyhk avatar Nov 20 '23 10:11 fouyhk

same problem

How to solve this problem

fouyhk avatar Nov 20 '23 10:11 fouyhk

请问现在解决了吗

Forever296 avatar Dec 01 '23 08:12 Forever296

同样的报错:AttributeError: 'ChatGLMForConditionalGeneration' object has no attribute 'lm_head'

jgbrblmd avatar Dec 29 '23 07:12 jgbrblmd