Baichuan2 icon indicating copy to clipboard operation
Baichuan2 copied to clipboard

推理未用到scaled_dot_product_attention

Open Huangyajuan-123 opened this issue 2 years ago • 1 comments

hf上写的: "在Baichuan2系列模型中,我们为了加快推理速度使用了Pytorch2.0加入的新功能F.scaled_dot_product_attention,因此模型需要在Pytorch2.0环境下运行。" 但是在看modeling_baichuan.py时发现只有在is_training的时候才会用到scaled_dot_product_attention,请问是我哪里理解错了吗?

Huangyajuan-123 avatar Sep 08 '23 11:09 Huangyajuan-123

我也发现了这个问题,只有 training 的时候才能使用 scaled_dot_product_attention,强行改了,会爆错

CarryChang avatar Jan 26 '24 09:01 CarryChang