You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-5Lines changed: 52 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ You can contact us and communicate with us by adding our group:
55
55
56
56
57
57
## 📝 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.
59
59
60
60
🍔 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.
For more optional dependencies, you can refer to [here](https://github.com/modelscope/ms-swift/blob/main/requirements/install_all.sh).
122
+
123
+
106
124
## 🚀 Quick Start
107
125
108
126
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
174
192
175
193
### Using Python
176
194
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).
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`.
217
238
218
239
| Useful Links |
219
240
| ------ |
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)|
221
242
|[Supported Models and Datasets](https://swift.readthedocs.io/en/latest/Instruction/Supported-models-and-datasets.html)|
| 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
+
227
265
Pre-training:
228
266
```shell
229
267
# 8*A100
@@ -322,6 +360,15 @@ CUDA_VISIBLE_DEVICES=0 swift export \
322
360
--output_dir Qwen2.5-7B-Instruct-AWQ
323
361
```
324
362
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
+
325
372
## 🏛 License
326
373
327
374
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