---
title: kuakua-based-gpt3
canonical_url: "https://www.modelscope.cn/models/Cherrytest/kuakua-based-gpt3"
md_url: "https://www.modelscope.cn/models/Cherrytest/kuakua-based-gpt3.md"
repository: Cherrytest/kuakua-based-gpt3
chinese_name: "基于gpt3微调的夸夸机器人"
last_updated: 2023-02-21
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - GPT3-1.3B
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - ch
domain:
  - nlp
downloads: 17
stars: 3
tags:
  - transformer
  - AliceMind
  - Alibaba
---

# kuakua-based-gpt3

> kuakua-based-gpt3 - Cherrytest 在 ModelScope 开源的模型。基于gpt-3和夸夸数据集训练出来的夸夸机器人

Cherrytest/kuakua-based-gpt3 是 ModelScope 魔搭社区上的text-generation模型，采用 Apache License 2.0 许可。

- **Repository**: Cherrytest/kuakua-based-gpt3
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Tags**: transformer, AliceMind, Alibaba
- **Downloads**: 17
- **Stars**: 3
- **Last updated**: 2023-02-21

Source: https://www.modelscope.cn/models/Cherrytest/kuakua-based-gpt3

---

# GPT3中文1.3B参数量文本生成模型
GPT-3模型是一个通用的预训练生成模型，使用Transformer的Decoder-only结构，可以用于解决下游各种类型的生成任务，特别是zero-shot生成能力。模型利用大量无监督数据，通过自回归任务进行预训练。可以用于解决文本生成相关的任务包含：文本摘要、问题生成、data-to-text等。

## 模型描述
通过夸夸数据集finetune了gpt3 1.3B模型。


## 期望模型使用方式以及适用范围
本模型可直接用于文本生成，也可以通过finetune用于各类文本理解的任务。用户可以自行尝试各种输入文档。具体调用方式请参考代码示例。

### 如何使用
该模型需要多卡GPU资源才能跑起来，目前我们免费提供试用的Notebook环境，使用的是单卡GPU，如果使用的Notebook环境推荐使用更小规模的[large](https://modelscope.cn/models/damo/nlp_gpt3_text-generation_chinese-large/summary)/[base](https://modelscope.cn/models/damo/nlp_gpt3_text-generation_chinese-base/summary)版本

#### 依赖安装
要使用中文GPT3进行推理，需要额外安装DeepSpeed依赖，推荐使用0.7.2版本。另外，我们将GPT3模型依赖的megatron相关代码打包到了单独的包中，以上两个包通过以下命令进行安装：

```
pip install deepspeed==0.7.2
pip install megatron_util -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
```

#### 代码范例
```python
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import torch 

if __name__ == '__main__':
    if torch.multiprocessing.get_start_method(allow_none=True) is None:
        torch.multiprocessing.set_start_method('spawn')
    input = '程序员脱发用什么洗发水'
    model_id = 'wenmengzhou/nlp_gpt3_chatbot_kuakua'
    pipe = pipeline(Tasks.text_generation, model=model_id)
    pipe.models = []
    
    print(pipe(input))
```

### 模型局限性以及可能的偏差
模型训练数据来源于网络，生成结果可能存在一定偏差。

## 训练数据介绍
数据来源于[wiki](https://huggingface.co/datasets/wikipedia)和[commoncrawl](https://commoncrawl.org/)

## 模型训练流程
本模型的训练分为两个阶段。第一阶段严格按照原始GPT3的参数设置进行：在中文wiki/ Common crawl等无监督数据上，通过自回归的训练任务训练了约300B字得到。第二阶段中，我们加入了多种有监督数据继续训练，使得模型具备多种任务的zero-shot的处理能力。

### 预处理
暂无

### 训练
暂无

### 推理加速
我们对大规模生成模型的推理速度进行了极致优化，13B模型128字的文本生成可以在1秒左右完成。

### 数据评估及结果

## 相关引用
我们将尽快推出本项目的技术报告，敬请期待！
