-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3f228b
commit 7a96d28
Showing
26 changed files
with
34,685 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 THU-PLM | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Asoul-reply | ||
|
||
本项目使用来自b站评论区的30w条评论对微调[CPM](https://github.com/TsinghuaAI/CPM-1-Generate)的大模型,并且在此基础上蒸馏而成。 | ||
|
||
大模型效果:[b站视频](https://www.bilibili.com/video/BV1L44y1b7gE) | ||
|
||
本项目是蒸馏后的模型,效果比源模型略低。 | ||
|
||
## 安装 | ||
|
||
首先安装pytorch等基础依赖,再安装[APEX](https://github.com/NVIDIA/apex#quick-start)以支持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" ./ | ||
``` | ||
|
||
或者使用智源提供的Docker容器。安装方式如下: | ||
``` | ||
docker pull dmye/cpm:v0 | ||
``` | ||
参考运行指令如下: | ||
``` | ||
sudo docker run --gpus '"device=0,1"' -it -v <path>:/CPM --name=cpm cpm:v0 | ||
``` | ||
其中`<path>`为代码所在目录,-v进行文件目录挂载 | ||
|
||
## 使用 | ||
|
||
下载好模型后放在项目根目录`models`文件夹中。 | ||
|
||
提供了命令行交互式生成: | ||
``` | ||
bash scripts/generate_text.sh | ||
``` | ||
运行该脚本需要两块GPU。 |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.