shibing624's picture
Update README.md
2e0ed5f
---
language:
- zh
tags:
- llama
- pytorch
- zh
- Text2Text-Generation
license: "apache-2.0"
widget:
- text: "用一句话描述地球为什么是独一无二的\n答:"
---
# Chinese QA LoRA Model
llama中文问答LoRA模型
`llama-13B-belle-zh-lora` evaluate test data:
The overall performance of llama-13B-belle-zh-lora on QA **test**:
|input_text|predict|
|:-- |:--- |
|用一句话描述地球为什么是独一无二的\n答:|地球是独一无二的,因为它是我们的家园,它是我们的生命的基础,它是我们的星球。|
在中文开放测试集中的表现优异,继承了两方面的优势:1)微调的底座是llama-13B模型,中文的表现优于LLAMA,2)微调使用的是高质量100万条中文ChatGPT指令Belle数据集,微调后的模型对话效果优于原始llama-13B。
## Usage
本项目开源在textgen项目:[textgen](https://github.com/shibing624/textgen),可支持llama模型,通过如下命令调用:
Install package:
```shell
pip install -U textgen
```
```python
from textgen import LlamaModel
model = LlamaModel("llama", "decapoda-research/llama-13b-hf", lora_name="shibing624/llama-13b-belle-zh-lora")
r = model.predict(["用一句话描述地球为什么是独一无二的\n答:"])
print(r) # ['地球是独一无二的,因为它是我们的家园,它是我们的生命的基础,它是我们的星球。']
```
模型文件组成:
```
llama-13b-belle-zh-lora
├── adapter_config.json
└── adapter_model.bin
```
### 训练数据集
1. 50万条中文ChatGPT指令Belle数据集:[BelleGroup/train_0.5M_CN](https://huggingface.co/datasets/BelleGroup/train_0.5M_CN)
2. 100万条中文ChatGPT指令Belle数据集:[BelleGroup/train_1M_CN](https://huggingface.co/datasets/BelleGroup/train_1M_CN)
3. 5万条英文ChatGPT指令Alpaca数据集:[50k English Stanford Alpaca dataset](https://github.com/tatsu-lab/stanford_alpaca#data-release)
4. 2万条中文ChatGPT指令Alpaca数据集:[shibing624/alpaca-zh](https://huggingface.co/datasets/shibing624/alpaca-zh)
5. 69万条中文指令Guanaco数据集(Belle50万条+Guanaco19万条):[Chinese-Vicuna/guanaco_belle_merge_v1.0](https://huggingface.co/datasets/Chinese-Vicuna/guanaco_belle_merge_v1.0)
如果需要训练llama模型,请参考[https://github.com/shibing624/textgen](https://github.com/shibing624/textgen)
## Citation
```latex
@software{textgen,
author = {Xu Ming},
title = {textgen: Implementation of language model finetune},
year = {2021},
url = {https://github.com/shibing624/textgen},
}
```