Skip to content

Commit

Permalink
Merge pull request #1142 from QwenLM/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
hzhwcmhf committed Mar 12, 2024
2 parents aa86275 + 82d6256 commit 86093dd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 30 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ We also measure the inference speed and GPU memory usage with different settings
### Usage
Now we provide the official training script, `finetune.py`, for users to finetune the pretrained model for downstream applications in a simple fashion. Additionally, we provide shell scripts to launch finetuning with no worries. This script supports the training with [DeepSpeed](https://github.com/microsoft/DeepSpeed) and [FSDP](https://engineering.fb.com/2021/07/15/open-source/fsdp/). The shell scripts that we provide use DeepSpeed (Note: this may have conflicts with the latest version of pydantic and you should use make sure `pydantic<2.0`) and Peft. You can install them by:
```bash
pip install peft deepspeed
pip install "peft<0.8.0" deepspeed
```

To prepare your training data, you need to put all the samples into a list and save it to a json file. Each sample is a dictionary consisting of an id and a list for conversation. Below is a simple example list with 1 sample:
Expand Down Expand Up @@ -889,18 +889,13 @@ The statistics are listed below:

For deployment and fast inference, we suggest using vLLM.

If you use cuda 12.1 and pytorch 2.1, you can directly use the following command to install vLLM.
If you use **CUDA 12.1 and PyTorch 2.1**, you can directly use the following command to install vLLM.

```bash
# pip install vllm # This line is faster but it does not support quantization models.

# The below lines support int4 quantization (int8 will be supported soon). The installation are slower (~10 minutes).
git clone https://github.com/QwenLM/vllm-gptq
cd vllm-gptq
pip install -e .
pip install vllm
```

Otherwise, please refer to the official vLLM [Installation Instructions](https://docs.vllm.ai/en/latest/getting_started/installation.html), or our [vLLM repo for GPTQ quantization](https://github.com/QwenLM/vllm-gptq).
Otherwise, please refer to the official vLLM [Installation Instructions](https://docs.vllm.ai/en/latest/getting_started/installation.html).

#### vLLM + Transformer-like Wrapper

Expand Down
13 changes: 4 additions & 9 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ model = AutoModelForCausalLM.from_pretrained(
### 使用方法
我们提供了`finetune.py`这个脚本供用户实现在自己的数据上进行微调的功能,以接入下游任务。此外,我们还提供了shell脚本减少用户的工作量。这个脚本支持 [DeepSpeed](https://github.com/microsoft/DeepSpeed)[FSDP](https://engineering.fb.com/2021/07/15/open-source/fsdp/) 。我们提供的shell脚本使用了DeepSpeed,因此建议您确保已经安装DeepSpeed和Peft(注意:DeepSpeed可能不兼容最新的pydantic版本,请确保`pydantic<2.0`)。你可以使用如下命令安装:
```bash
pip install peft deepspeed
pip install "peft<0.8.0" deepspeed
```

首先,你需要准备你的训练数据。你需要将所有样本放到一个列表中并存入json文件中。每个样本对应一个字典,包含id和conversation,其中后者为一个列表。示例如下所示:
Expand Down Expand Up @@ -879,18 +879,13 @@ print(response)
### vLLM
如希望部署及加速推理,我们建议你使用vLLM。

如果你使用cuda12.1和pytorch2.1,可以直接使用以下命令安装vLLM。
如果你使用**CUDA 12.1和PyTorch 2.1**,可以直接使用以下命令安装vLLM。

```bash
# pip install vllm # 该方法安装较快,但官方版本不支持量化模型

# 下面方法支持int4量化 (int8量化模型支持将近期更新),但安装更慢 (约~10分钟)。
git clone https://github.com/QwenLM/vllm-gptq
cd vllm-gptq
pip install -e .
pip install vllm
```

否则请参考vLLM官方的[安装说明](https://docs.vllm.ai/en/latest/getting_started/installation.html),或者安装我们[vLLM分支仓库](https://github.com/QwenLM/vllm-gptq)
否则请参考vLLM官方的[安装说明](https://docs.vllm.ai/en/latest/getting_started/installation.html)

#### vLLM + 类Transformer接口

Expand Down
2 changes: 1 addition & 1 deletion README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ También medimos la velocidad de inferencia y el uso de memoria de la GPU con di
### Utilización
Ahora proporcionamos el script de entrenamiento oficial, `finetune.py`, para que los usuarios puedan ajustar el modelo preentrenado para aplicaciones posteriores de forma sencilla. Además, proporcionamos scripts de shell para lanzar el ajuste fino sin preocupaciones. Este script soporta el entrenamiento con [DeepSpeed](https://github.com/microsoft/DeepSpeed) y [FSDP](https://engineering.fb.com/2021/07/15/open-source/fsdp/). Los shell scripts que proporcionamos utilizan DeepSpeed (Nota: esto puede tener conflictos con la última versión de pydantic y debe utilizar make sure `pydantic<2.0`) y Peft. Puede instalarlos de la siguiente manera:
```bash
pip install peft deepspeed
pip install "peft<0.8.0" deepspeed
```

Para preparar tus datos de entrenamiento, necesitas poner todas las muestras en una lista y guardarla en un archivo json. Cada muestra es un diccionario que consiste en un id y una lista para la conversación. A continuación se muestra una lista de ejemplo simple con 1 muestra:
Expand Down
2 changes: 1 addition & 1 deletion README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ Nous mesurons également la vitesse d'inférence et l'utilisation de la mémoire
### Utilisation
Nous fournissons maintenant le script d'entraînement officiel, `finetune.py`, pour que les utilisateurs puissent ajuster le modèle pré-entraîné pour les applications en aval de manière simple. De plus, nous fournissons des scripts shell pour lancer le finetune sans soucis. Ce script prend en charge l'entraînement avec [DeepSpeed](https://github.com/microsoft/DeepSpeed) et [FSDP](https://engineering.fb.com/2021/07/15/open-source/fsdp/). Les scripts que nous fournissons utilisent DeepSpeed (Note : il peut y avoir des conflits avec la dernière version de pydantic et vous devriez utiliser make sure `pydantic<2.0`) et Peft. Vous pouvez les installer en procédant comme suit :
```bash
pip install peft deepspeed
pip install "peft<0.8.0" deepspeed
```

Pour préparer vos données d'entraînement, vous devez rassembler tous les échantillons dans une liste et l'enregistrer dans un fichier json. Chaque échantillon est un dictionnaire composé d'un identifiant et d'une liste de conversation. Voici un exemple simple de liste avec 1 échantillon :
Expand Down
13 changes: 4 additions & 9 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ BF16、Int8、および Int4 のモデルを使用して 2048 を生成する際
### 使用方法
現在、公式のトレーニングスクリプト `finetune.py` を提供しています。さらに、finetune.pyのシェルスクリプトを提供し、finetune.pyを実行することで、finetune.pyを起動することができる。さらに、安心してファインチューニングを開始するためのシェルスクリプトも提供しています。このスクリプトは、[DeepSpeed](https://github.com/microsoft/DeepSpeed) (注意:これはpydanticの最新バージョンとコンフリクトする可能性があるので、`pydantic<2.0`にする必要があります) および [FSDP](https://engineering.fb.com/2021/07/15/open-source/fsdp/) を使用したトレーニングをサポートします。弊社が提供するシェル・スクリプトは DeepSpeed と Peft を使用するため、事前に DeepSpeed と Peft をインストールすることをお勧めします:
```bash
pip install -r requirements_finetune.txt
pip install "peft<0.8.0" deepspeed
```

学習データを準備するには、すべてのサンプルをリストにまとめ、jsonファイルに保存する必要があります。各サンプルはidと会話リストで構成される辞書です。以下は1つのサンプルを含む単純なリストの例です:
Expand Down Expand Up @@ -782,17 +782,12 @@ Qwen-72B については、2 つの方法で実験します。1) 4 つの A100-S
### vLLM
デプロイメントと高速推論のためには、vLLMを使用することをお勧めします。

cuda 12.1 および pytorch 2.1 を使用している場合は、次のコマンドを直接使用して vLLM をインストールできます。
**CUDA 12.1** および **PyTorch 2.1** を使用している場合は、次のコマンドを直接使用して vLLM をインストールできます。
```bash
# pip install vllm # この行はより速いですが、量子化モデルをサポートしていません。

# 以下のはINT4の量子化をサポートします(INT8はまもなくサポートされます)。 インストールは遅くなります(〜10分)。
git clone https://github.com/QwenLM/vllm-gptq
cd vllm-gptq
pip install -e .
pip install vllm
```

それ以外の場合は、公式 vLLM [インストール手順](https://docs.vllm.ai/en/latest/getting_started/installation.html) 、または[GPTQの量子化 vLLM レポ](https://github.com/QwenLM/vllm-gptq)を参照してください。
それ以外の場合は、公式 vLLM [インストール手順](https://docs.vllm.ai/en/latest/getting_started/installation.html) を参照してください。

#### vLLM + Transformer Wrapper

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
transformers==4.32.0
transformers>=4.32.0,<4.38.0
accelerate
tiktoken
einops
Expand Down

0 comments on commit 86093dd

Please sign in to comment.