---
title: Qwen-7B-Chat-Cantonese
canonical_url: "https://www.modelscope.cn/models/stvlynn/Qwen-7B-Chat-Cantonese"
md_url: "https://www.modelscope.cn/models/stvlynn/Qwen-7B-Chat-Cantonese.md"
repository: stvlynn/Qwen-7B-Chat-Cantonese
chinese_name: "通义千问·粤语"
last_updated: 2024-05-05
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen
architectures:
  - QWenLMHeadModel
parameters: 7.7B
tensor_type:
  - F16
library_name:
  - safetensors
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 203
stars: 8
---

# Qwen-7B-Chat-Cantonese

> Qwen-7B-Chat-Cantonese - stvlynn 在 ModelScope 开源的模型。Qwen-7B-Chat-Cantonese 简介 Qwen-7B-Chat-Cantonese 是基于 Qwen-7B-Chat 的微调版本，采用大量的粤语数据进行训练。

stvlynn/Qwen-7B-Chat-Cantonese 是 ModelScope 魔搭社区上的 7.7B 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: stvlynn/Qwen-7B-Chat-Cantonese
- **Tasks**: text-generation
- **Parameters**: 7.7B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 203
- **Stars**: 8
- **Last updated**: 2024-05-05

Source: https://www.modelscope.cn/models/stvlynn/Qwen-7B-Chat-Cantonese

---

# Qwen-7B-Chat-Cantonese
## 简介
Qwen-7B-Chat-Cantonese 是基于 Qwen-7B-Chat 的微调版本，采用大量的粤语数据进行训练。

[Huggingface](https://huggingface.co/stvlynn/Qwen-7B-Chat-Cantonese)

## 使用说明

### 要求

* Python 3.8 及以上
* Pytorch 1.12 及以上，推荐 2.0 及以上
* 推荐使用 CUDA 11.4 及以上（这是针对 GPU 用户、快速注意力用户等）

### 依赖

要运行 Qwen-7B-Chat-Cantonese，请确保满足以上要求，然后执行以下 pip 命令安装依赖库。

```bash
pip install transformers==4.32.0 accelerate tiktoken einops scipy transformers_stream_generator==0.0.4 peft deepspeed
```

此外，推荐安装 `flash-attention` 库

```bash
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention && pip install .
```

### 快速开始

请转到 QwenLM/Qwen - [快速开始](https://github.com/QwenLM/Qwen?tab=readme-ov-file#quickstart)

## 训练参数

| 参数               | 描述                           | 值    |
|-------------------|--------------------------------|------|
| 学习率              | AdamW 优化器的学习率           | 7e-5 |
| 权重衰减            | 正则化强度                     | 0.8  |
| 伽马               | 学习率衰减因子                  | 1.0  |
| 批次大小            | 每批样本数量                    | 1000 |
| 精度               | 浮点精度                       | fp16 |
| 学习政策            | 学习率调整政策                  | cosine |
| 热身步骤            | 初始无学习率调整的步骤数         | 0    |
| 总步骤              | 总训练步骤数                    | 1024 |
| 梯度累积步骤         | 更新前累积梯度的步骤数          | 8    |

![loss](https://cdn.statically.io/gh/stvlynn/cloudimg@master/blog/2310/image.q9v1ak08ljk.webp)

## 演示
![深水埗有哪些美食](https://cdn.statically.io/gh/stvlynn/cloudimg@master/blog/2310/截屏2024-05-04-11.59.27.2bea6k113e68.webp)

![鲁迅为什么打周树人](https://cdn.statically.io/gh/stvlynn/cloudimg@master/blog/2310/截屏2024-05-04-11.56.46.72tt5czl2gw0.webp)

![树上几只鸟](https://cdn.statically.io/gh/stvlynn/cloudimg@master/blog/2310/截屏2024-05-04-12.00.38.267hvmc3z3c0.webp)

## 特别说明

这是我的第一个微调LLM。请多指教。

如果您有任何问题或建议请随时联系我。

[TG @stvlynn_bot](https://tg.stv.pm)

[电子邮件 i@stv.pm](mailto:i@stv.pm)
