ChatGLM-6B
ChatGLM-6B copied to clipboard
[BUG] 使用ChatGLMForConditionalGeneration加载模型的hidden_states返回值是空
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
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
改了以后下次loading又会自动改回去怎么办?