Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PaddleV3] 新增大模型 pytorch 中的 MT5 #1086

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

megemini
Copy link
Contributor

@megemini megemini commented Oct 29, 2024

Create A Good Pull Request

新增大模型 pytorch 中的 MT5

需要在 datasetPyTorch/dataset/ 中新建 mt5_small 文件夹,其目录结构如下:

image

其中,checkpoints 目录放置模型文件:

  • config.json
  • pytorch_model.bin

模型文件需要从 https://hf-mirror.com/google/mt5-small/tree/main 中下载 ~

另外,输入输出文件:

  • pytorch_input.pkl
  • pytorch_output.pkl

output 是通过 pytorch 运行获得,input 参考 transformers 的例子:

article = "UN Offizier sagt, dass weiter verhandelt werden muss in Syrien."
summary = "Weiter Verhandlung in Syrien."

转换后的结果 ~
可从如下共享网盘中获取:https://pan.baidu.com/s/1PhxvkbYotzbyzxutd5nYHQ ~ 提取码请私信获取 ~

模型文件上传至服务器后,可重新运行 CI ~

以下为本地验证的结果:

  • > sh run_convert.sh

image

  • > sh run_benchmark.sh

image

  • > python deploy_infer.py

image

@luotao1

@luotao1 luotao1 added the contributor External developers label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants