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

[BUG] 使用ChatGLMForConditionalGeneration加载模型的hidden_states返回值是空

Open 971044030 opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

使用ChatGLMForConditionalGeneration生成向量,取值取不到

Expected Behavior

No response

Steps To Reproduce

1

Environment

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

Anything else?

No response

971044030 avatar Apr 14 '23 06:04 971044030

https://huggingface.co/THUDM/chatglm-6b/blob/658202d88ac4bb782b99e99ac3adff58b4d0b813/modeling_chatglm.py#L1228

这里改为hidden_states=hidden_states 或 hidden_states=transformer_outputs[0]

参考: https://huggingface.co/THUDM/chatglm-6b/blob/658202d88ac4bb782b99e99ac3adff58b4d0b813/modeling_chatglm.py#L1202

yinzhang809 avatar May 05 '23 09:05 yinzhang809

改了以后下次loading又会自动改回去怎么办?

Gaoeee avatar Jan 15 '24 01:01 Gaoeee