Skip to content

Commit 4f34edf

Browse files
authored
update readme (#3011)
1 parent 80d96c1 commit 4f34edf

File tree

7 files changed

+114
-22
lines changed

7 files changed

+114
-22
lines changed

README.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can contact us and communicate with us by adding our group:
5555

5656

5757
## 📝 Introduction
58-
🍲 ms-swift is an official framework provided by the ModelScope community for fine-tuning and deploying large language models and multi-modal large models. It currently supports the training (pre-training, fine-tuning, human alignment), inference, evaluation, quantization, and deployment of 450+ large models and 150+ multi-modal large models. These large language models (LLMs) include models such as Qwen2.5, InternLM3, GLM4, Llama3.3, Mistral, DeepSeek3, Yi1.5, TeleChat2, Baichuan2, and Gemma2. The multi-modal LLMs include models such as Qwen2.5-VL, Qwen2-Audio, Llama3.2-Vision, Llava, InternVL2.5, MiniCPM-V-2.6, GLM4v, Xcomposer2.5, Yi-VL, DeepSeek-VL2, Phi3.5-Vision, and GOT-OCR2.
58+
🍲 ms-swift is an official framework provided by the ModelScope community for fine-tuning and deploying large language models and multi-modal large models. It currently supports the training (pre-training, fine-tuning, human alignment), inference, evaluation, quantization, and deployment of 450+ large models and 150+ multi-modal large models. These large language models (LLMs) include models such as Qwen2.5, InternLM3, GLM4, Llama3.3, Mistral, DeepSeek-R1, Yi1.5, TeleChat2, Baichuan2, and Gemma2. The multi-modal LLMs include models such as Qwen2.5-VL, Qwen2-Audio, Llama3.2-Vision, Llava, InternVL2.5, MiniCPM-V-2.6, GLM4v, Xcomposer2.5, Yi-VL, DeepSeek-VL2, Phi3.5-Vision, and GOT-OCR2.
5959

6060
🍔 In addition, ms-swift gathers the latest training technologies, including LoRA, QLoRA, Llama-Pro, LongLoRA, GaLore, Q-GaLore, LoRA+, LISA, DoRA, FourierFt, ReFT, UnSloth, and Liger. ms-swift supports acceleration of inference, evaluation, and deployment modules using vLLM and LMDeploy, and supports the quantization of large models and multi-modal large models using technologies such as GPTQ, AWQ, and BNB. To help researchers and developers fine-tune and apply large models more easily, ms-swift also provides a Gradio-based Web-UI interface and a wealth of best practices.
6161

@@ -103,6 +103,24 @@ cd ms-swift
103103
pip install -e .
104104
```
105105

106+
Running Environment:
107+
108+
| | Range | Recommended | Notes |
109+
| ------------ | -------------------- | ----------- | ----------------------------------------- |
110+
| python | >=3.8 | 3.10 | |
111+
| cuda | | cuda12 | No need to install if using CPU, NPU, MPS |
112+
| torch | >=2.0 | | |
113+
| transformers | >=4.33 | 4.48.1 | |
114+
| modelscope | >=1.19 | | |
115+
| peft | >=0.11.0,<0.15.0 | | |
116+
| trl | >=0.13,<0.15 | 0.14.0 | RLHF |
117+
| vllm | >=0.5.1 | 0.6.5 | Inference/Deployment/Evaluation |
118+
| lmdeploy | lmdeploy>=0.5,<0.6.5 | 0.6.4 | Inference/Deployment/Evaluation |
119+
| deepspeed | | 0.14.5 | Training |
120+
121+
For more optional dependencies, you can refer to [here](https://github.com/modelscope/ms-swift/blob/main/requirements/install_all.sh).
122+
123+
106124
## 🚀 Quick Start
107125

108126
10 minutes of self-cognition fine-tuning of Qwen2.5-7B-Instruct on a single 3090 GPU:
@@ -174,7 +192,7 @@ SWIFT_UI_LANG=en swift web-ui
174192

175193
### Using Python
176194

177-
ms-swift also supports training and inference using Python. Below is pseudocode for training and inference. For more details, you can refer to [here](https://github.com/modelscope/ms-swift/tree/main/examples/notebook).
195+
ms-swift also supports training and inference using Python. Below is pseudocode for training and inference. For more details, you can refer to [here](https://github.com/modelscope/ms-swift/blob/main/examples/notebook/qwen2_5-self-cognition/self-cognition-sft.ipynb).
178196

179197
Training:
180198

@@ -213,17 +231,37 @@ print(f'response: {resp_list[0].choices[0].message.content}')
213231
```
214232

215233
## ✨ Usage
216-
Here is the simplest example of training to deployment using ms-swift. For more details, you can check the [examples](https://github.com/modelscope/ms-swift/tree/main/examples).
234+
Here is a minimal example of training to deployment using ms-swift. For more details, you can check the [examples](https://github.com/modelscope/ms-swift/tree/main/examples).
235+
236+
- If you want to use other models or datasets (including multimodal models and datasets), you only need to modify `--model` to specify the corresponding model's ID or path, and modify `--dataset` to specify the corresponding dataset's ID or path.
237+
- By default, ModelScope is used for downloading models and datasets. If you want to use HuggingFace, simply specify `--use_hf true`.
217238

218239
| Useful Links |
219240
| ------ |
220-
| [Command Line Parameters](https://swift.readthedocs.io/en/latest/Instruction/Command-line-parameters.html) |
241+
| [🔥Command Line Parameters](https://swift.readthedocs.io/en/latest/Instruction/Command-line-parameters.html) |
221242
| [Supported Models and Datasets](https://swift.readthedocs.io/en/latest/Instruction/Supported-models-and-datasets.html) |
222-
| [Custom Models](https://swift.readthedocs.io/en/latest/Customization/Custom-model.html), [Custom Datasets](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html) |
243+
| [Custom Models](https://swift.readthedocs.io/en/latest/Customization/Custom-model.html), [🔥Custom Datasets](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html) |
223244
| [LLM Tutorial](https://github.com/modelscope/modelscope-classroom/tree/main/LLM-tutorial) |
224245

225246
### Training
226247

248+
Supported Training Methods:
249+
250+
| Method | Full-Parameter | LoRA | QLoRA | Deepspeed | Multi-modal |
251+
| ---------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
252+
| Pre-training | [](https://github.com/modelscope/ms-swift/blob/main/examples/train/pretrain/train.sh) |||||
253+
| Instruction Supervised Fine-tuning | [](https://github.com/modelscope/ms-swift/blob/main/examples/train/full/train.sh) | [](https://github.com/modelscope/ms-swift/blob/main/examples/train/lora_sft.sh) | [](https://github.com/modelscope/ms-swift/tree/main/examples/train/qlora) | [](https://github.com/modelscope/ms-swift/tree/main/examples/train/multi-gpu/deepspeed) | [](https://github.com/modelscope/ms-swift/tree/main/examples/train/multimodal) |
254+
| DPO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/dpo.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/dpo.sh) | [](https://github.com/modelscope/ms-swift/blob/main/examples/train/multimodal/rlhf/dpo.sh) |
255+
| Reward Model Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/rm.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/rm.sh) ||
256+
| PPO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/ppo.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/ppo.sh) ||
257+
| KTO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/kto.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/kto.sh) | [](https://github.com/modelscope/ms-swift/blob/main/examples/train/multimodal/rlhf/kto.sh) |
258+
| CPO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/cpo.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/cpo.sh) ||
259+
| SimPO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/simpo.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/simpo.sh) ||
260+
| ORPO Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/orpo.sh) || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/rlhf/orpo.sh) ||
261+
| Classification Model Training || [](https://github.com/modelscope/ms-swift/blob/main/examples/train/seq_cls/qwen2_5/sft.sh) ||| [](https://github.com/modelscope/ms-swift/blob/main/examples/train/seq_cls/qwen2_vl/sft.sh) |
262+
263+
264+
227265
Pre-training:
228266
```shell
229267
# 8*A100
@@ -322,6 +360,15 @@ CUDA_VISIBLE_DEVICES=0 swift export \
322360
--output_dir Qwen2.5-7B-Instruct-AWQ
323361
```
324362

363+
### Push Model
364+
```shell
365+
CUDA_VISIBLE_DEVICES=0 swift export \
366+
--model <model-path> \
367+
--push_to_hub true \
368+
--hub_model_id '<model-id>' \
369+
--hub_token '<sdk-token>'
370+
```
371+
325372
## 🏛 License
326373

327374
This framework is licensed under the [Apache License (Version 2.0)](https://github.com/modelscope/modelscope/blob/master/LICENSE). For models and datasets, please refer to the original resource page and follow the corresponding License.

0 commit comments

Comments
 (0)