fastnlp / CPT

CPT: A Pre-Trained Unbalanced Transformer for Both Chinese Language Understanding and Generation
481 stars 70 forks source link

TypeError: forward() got an unexpected keyword argument 'labels' #77

Closed runningabcd closed 9 months ago

runningabcd commented 9 months ago

run run_gen.py

error msg

TypeError: forward() got an unexpected keyword argument 'labels'

transformers==4.29.2 torch==1.13.1

runningabcd commented 9 months ago

traceback modeling_cpt.py

截屏2023-12-26 11 08 13
runningabcd commented 9 months ago

使用run_gen.py进行微调时,遇到错误 TypeError: forward() got an unexpected keyword argument 'labels' 通过 traceback 发现错误发生在 modeling_cpt.py 中 856行

这个问题是因为版本不一致导致的?怎么解决呢

runningabcd commented 9 months ago

我尝试修改modeling_cpt.py 中 856行, 直接pop labels 参数,但是不清楚这样对整体逻辑是否有影响