摘要:
以使用google-bert/bert-base-chinese 模型为例 下载预训练模型官方站点:https://www.huggingface.co/(如果无法访问,使用镜像站点)镜像站点:https://hf-mirror.com/搜索框内搜索自己需要的模型,点击Files and versi 阅读全文
posted @ 2024-11-13 21:50
django_start
阅读(174)
评论(0)
推荐(0)
摘要:
在模型训练之后,需要保存,可以选择这种方式,只保存参数,不全部保存,推荐这种方式。保存模型 torch.save(model.state_dict(), 'my_model.pth') 加载模型重新实例化自己的模型,不要和之前的训练模型冲突 loaded_model = NewsClassifier 阅读全文
posted @ 2024-11-13 21:32
django_start
阅读(121)
评论(0)
推荐(0)

浙公网安备 33010602011771号