PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.73k stars 2.86k forks source link

[Question]: 对于paddlenlp模型库中不存在的大模型,但pytorch中已有实现,如何快速搭建模型? #8391

Open zhaogf01 opened 1 month ago

zhaogf01 commented 1 month ago

请提出你的问题

1、请问有没有比较好的思路?

2、如果权重文件已经转换为paddle的形式,对于paddlenlp模型库中不存在的大模型,我们是否可以使用快速验证? image

3、将权重从pytorch转为paddle的格式,https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/model_convert/convert_from_pytorch/nlp_fast_explore_cn.html#quanzhongzhuanhuan
权重转换是根据这个文档操作吧?转换时遇到一个报错 image

ZHUI commented 1 month ago

https://paddlenlp.readthedocs.io/zh/latest/llm/torch2paddle.html 试试这个教程

zhaogf01 commented 1 month ago

https://paddlenlp.readthedocs.io/zh/latest/llm/torch2paddle.html 试试这个教程 image

会有这样的报错,请问您知道怎么回事吗? 而且我看这个链接下有一个支持的模型列表,我所需要转换的模型不在这个列表中,也可以使用这个脚本吗?

zhaogf01 commented 1 month ago

还想请问一个问题,如何将pytorch中使用的.bin格式的权重转换为paddle中.safetensors格式的权重? 此外,sentencepiece.bpe.model应该如何转换的,或者如化生成的,这个文件的作用是什么?