liuwei1206 / LEBERT

Code for the ACL2021 paper "Lexicon Enhanced Chinese Sequence Labelling Using BERT Adapter"
336 stars 60 forks source link

do_predict问题 #42

Closed Yesgo1220 closed 2 years ago

Yesgo1220 commented 2 years ago

对torch不太熟悉,请问在只do_predict的时候,没有找到load_state_dict这样的操作,模型是怎么预测的?麻烦指点一二,感谢。作者是否应该在do_predict中加上model.load_state_dict(torch.load(model_name))

liuwei1206 commented 2 years ago

Hi,

Thanks for your comment. When do evaluation or prediction, I will change the model_name_or_path with the trained checkpoint. In this way, you can load it with from_pretrain function.

Best