thunlp / OpenPrompt

An Open-Source Framework for Prompt-Learning.
https://thunlp.github.io/OpenPrompt/
Apache License 2.0
4.38k stars 455 forks source link

能否提供训练后的soft template如何保存以及加载的代码? #197

Closed zjk000 closed 2 years ago

zjk000 commented 2 years ago

tutorial/1.4_soft_template.py 中的soft template训练后如何保存以及保存后如何加载能否提供demo code?谢谢

Achazwl commented 2 years ago

simply using torch.save(prompt_model.template.state_dict()) is enough, and torch.load for loading.