PaddleNLP
PaddleNLP copied to clipboard
[Bug]: GPTModel.from_pretrained() 加载仅有 config 无权重文件模型 "gpt2-small-en" 报错 FileNotFoundError
软件环境
- paddlepaddle-gpu: 2.3.2.post116
- paddlenlp: 2.4.0
重复问题
- [X] I have searched the existing issues
错误描述
当使用 `GPTModel.from_pretrained("gpt2-small-en")`时无法创建模型,报错:
FileNotFoundError: [Errno 2] No such file or directory: '/home/username/.paddlenlp/models/gpt2-small-en/model_config.json'
而事实上在该目录下,连 gpt2-small-en 文件夹也没有创建。
更新 paddlenlp 版本至 2.4.1 也不能解决该问题。
稳定复现步骤 & 代码
首先删除本地已有的文件夹
rm -rf ~/.paddlenlp/models/gpt2-small-en
然后运行以下脚本
from paddlenlp.transformers import GPTModel
gpt = GPTModel.from_pretrained("gpt2-small-en")
当前 gpt2-small-en 模型是一个 CE 随机模型,仅有设置 pretrained_init_configuration 而无 pretrained_resource_files_map,@guoshengCS @wj-Mcat 看看 from_pretrained() 的是否有相关修改删除了这个功能。
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。