CPM-Generate:中文预训练语言模型(CPM-LM)版本-I-源码

上传者: 42101384 | 上传时间: 2021-08-23 20:41:46 | 文件大小: 926KB | 文件类型: ZIP
千次曝光出价产生 为了促进中文自然语言处理研究的发展,本项目提供了CPM-LM (2.6B)模型的文本生成代码,可用于文本生成的本地测试,并同时为基础进一步研究零次学习/少次学习等场景。[] [] [] 安装 首先安装pytorch等基础依赖,再安装以支持fp16: pip install -r requirements.txt git clone https://github.com/NVIDIA/apex cd apex pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ 考虑到apex的安装容易发生问题,我们内置了对应的Docker容器,可以进行快速环境搭建。安装方式如下: docker pull dmye/cpm:v0 参考运行指令如下: sudo

文件下载

资源详情

[{"title":"( 64 个子文件 926KB ) CPM-Generate:中文预训练语言模型(CPM-LM)版本-I-源码","children":[{"title":"CPM-Generate-main","children":[{"title":"bpe_3w_new","children":[{"title":"vocab.json <span style='color:#111;'> 698.46KB </span>","children":null,"spread":false},{"title":"chinese_vocab.vocab <span style='color:#111;'> 490.37KB </span>","children":null,"spread":false},{"title":"chinese_vocab.model <span style='color:#111;'> 696.51KB </span>","children":null,"spread":false}],"spread":true},{"title":"mpu","children":[{"title":"utils.py <span style='color:#111;'> 2.65KB </span>","children":null,"spread":false},{"title":"cross_entropy.py <span style='color:#111;'> 4.61KB </span>","children":null,"spread":false},{"title":"tests","children":[{"title":"test_random.py <span style='color:#111;'> 6.54KB </span>","children":null,"spread":false},{"title":"test_data.py <span style='color:#111;'> 2.85KB </span>","children":null,"spread":false},{"title":"commons.py <span style='color:#111;'> 2.56KB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"test_cross_entropy.py <span style='color:#111;'> 3.78KB </span>","children":null,"spread":false},{"title":"test_layers.py <span style='color:#111;'> 18.82KB </span>","children":null,"spread":false},{"title":"test_initialize.py <span style='color:#111;'> 3.42KB </span>","children":null,"spread":false}],"spread":true},{"title":"__init__.py <span style='color:#111;'> 2.00KB </span>","children":null,"spread":false},{"title":"random.py <span style='color:#111;'> 14.22KB </span>","children":null,"spread":false},{"title":"layers.py <span style='color:#111;'> 13.09KB </span>","children":null,"spread":false},{"title":"initialize.py <span style='color:#111;'> 4.77KB </span>","children":null,"spread":false},{"title":"grads.py <span style='color:#111;'> 2.94KB </span>","children":null,"spread":false},{"title":"mappings.py <span style='color:#111;'> 4.04KB </span>","children":null,"spread":false},{"title":"transformer.py <span style='color:#111;'> 27.58KB </span>","children":null,"spread":false},{"title":"data.py <span style='color:#111;'> 3.92KB </span>","children":null,"spread":false}],"spread":false},{"title":"utils.py <span style='color:#111;'> 11.88KB </span>","children":null,"spread":false},{"title":"zero-shot-cls.py <span style='color:#111;'> 18.19KB </span>","children":null,"spread":false},{"title":"data","children":[{"title":"dataset_utils.py <span style='color:#111;'> 14.52KB </span>","children":null,"spread":false},{"title":"test","children":[{"title":"test_preprocess_data.sh <span style='color:#111;'> 241B </span>","children":null,"spread":false},{"title":"test_indexed_dataset.py <span style='color:#111;'> 4.51KB </span>","children":null,"spread":false}],"spread":true},{"title":"__init__.py <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"indexed_dataset.py <span style='color:#111;'> 18.10KB </span>","children":null,"spread":false},{"title":"samplers.py <span style='color:#111;'> 5.91KB </span>","children":null,"spread":false},{"title":"helpers.cpp <span style='color:#111;'> 13.68KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 279B </span>","children":null,"spread":false},{"title":"gpt2_dataset.py <span style='color:#111;'> 12.98KB </span>","children":null,"spread":false},{"title":"bert_dataset.py <span style='color:#111;'> 11.42KB </span>","children":null,"spread":false}],"spread":true},{"title":"model","children":[{"title":"gpt2_modeling.py <span style='color:#111;'> 4.54KB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 852B </span>","children":null,"spread":false},{"title":"model.py <span style='color:#111;'> 3.67KB </span>","children":null,"spread":false},{"title":"modeling.py <span style='color:#111;'> 65.33KB </span>","children":null,"spread":false},{"title":"distributed.py <span style='color:#111;'> 4.78KB </span>","children":null,"spread":false}],"spread":true},{"title":"fp16","children":[{"title":"fp16util.py <span style='color:#111;'> 7.50KB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 941B </span>","children":null,"spread":false},{"title":"fp16.py <span style='color:#111;'> 30.97KB </span>","children":null,"spread":false},{"title":"loss_scaler.py <span style='color:#111;'> 9.55KB </span>","children":null,"spread":false}],"spread":true},{"title":"data_utils","children":[{"title":"tokenization.py <span style='color:#111;'> 35.14KB </span>","children":null,"spread":false},{"title":"datasets.py <span style='color:#111;'> 30.97KB </span>","children":null,"spread":false},{"title":"tf_dl.py <span style='color:#111;'> 5.32KB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 5.23KB </span>","children":null,"spread":false},{"title":"wordpiece.py <span style='color:#111;'> 15.23KB </span>","children":null,"spread":false},{"title":"corpora.py <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"samplers.py <span style='color:#111;'> 5.63KB </span>","children":null,"spread":false},{"title":"tokenization_gpt2.py <span style='color:#111;'> 2.34KB </span>","children":null,"spread":false},{"title":"file_utils.py <span style='color:#111;'> 8.24KB </span>","children":null,"spread":false},{"title":"lazy_loader.py <span style='color:#111;'> 6.73KB </span>","children":null,"spread":false}],"spread":true},{"title":"arguments.py <span style='color:#111;'> 18.47KB </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"example.txt <span style='color:#111;'> 69B </span>","children":null,"spread":false},{"title":"configure_data.py <span style='color:#111;'> 8.81KB </span>","children":null,"spread":false},{"title":"generate_samples.py <span style='color:#111;'> 14.33KB </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 121B </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 4.18KB </span>","children":null,"spread":false},{"title":"scripts","children":[{"title":"generate_text.sh <span style='color:#111;'> 816B </span>","children":null,"spread":false},{"title":"zero-shot-ocnli.sh <span style='color:#111;'> 686B </span>","children":null,"spread":false},{"title":"zero-shot-tnews.sh <span style='color:#111;'> 686B </span>","children":null,"spread":false},{"title":"zero-shot-iflytek.sh <span style='color:#111;'> 706B </span>","children":null,"spread":false}],"spread":false},{"title":"change_mp.py <span style='color:#111;'> 5.61KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明