Skip to content

Commit

Permalink
Merge commit '6524bcc5caf7b63307f458fe45356ad18bf8f3b1' into feat/rft…
Browse files Browse the repository at this point in the history
…-qwen-prm

* commit '6524bcc5caf7b63307f458fe45356ad18bf8f3b1': (21 commits)
  Fix vllm docs link & fix web-ui (modelscope#2970)
  add "enable_prefix_caching" args for vllm engine. (modelscope#2939)
  fix install_all.sh
  ppo compat transformers>=4.47.* (modelscope#2964)
  fix seq_cls patcher (modelscope#2963)
  fix max_length error print (modelscope#2960)
  update quant_mllm shell (modelscope#2959)
  update web-ui images (modelscope#2958)
  update requirements (modelscope#2957)
  fix bugs (modelscope#2954)
  fix citest (modelscope#2953)
  fix infer_stream (modelscope#2952)
  fix demo_hf (modelscope#2951)
  support deepseek_r1_distill (modelscope#2946)
  Fix mllm seq cls (modelscope#2945)
  Support minimax (modelscope#2943)
  Fix quant template (modelscope#2942)
  support deepseek-ai/DeepSeek-R1 (modelscope#2940)
  fix bugs (modelscope#2938)
  Support mllm seq_cls/rm (modelscope#2934)
  ...
  • Loading branch information
tastelikefeet committed Jan 23, 2025
2 parents d7d7d47 + 6524bcc commit e77044a
Show file tree
Hide file tree
Showing 103 changed files with 1,074 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .dev_scripts/ci_container_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then

pip install -r requirements/framework.txt -U -i https://mirrors.aliyun.com/pypi/simple/
pip install diffusers decord einops -U -i https://mirrors.aliyun.com/pypi/simple/
pip install autoawq!=0.2.7.post3 -U --no-deps
pip install autoawq -U --no-deps

# test with install
pip install .
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Web-UI是基于gradio界面技术的**零门槛**训练、部署界面方案,
```shell
swift web-ui
```
![image.png](./docs/resources/web-ui.png)
![image.png](./docs/resources/web-ui.jpg)

### 使用Python
ms-swift也支持使用python的方式进行训练和推理。下面给出训练和推理的**伪代码**,具体可以查看[这里](https://github.com/modelscope/ms-swift/tree/main/examples/notebook)
Expand Down
Binary file modified docs/resources/web-ui-en.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/resources/web-ui.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/resources/web-ui.png
Binary file not shown.
16 changes: 16 additions & 0 deletions docs/source/GetStarted/Web-UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ swift web-ui --lang zh/en

开启界面训练和推理。

SWIFT web-ui是命令行的高级封装,即,在界面上启动的训练、部署等任务,会在系统中以命令行启动一个独立的进程,伪代码类似:
```python
import os
os.system('swift sft --model xxx --dataset xxx')
```

这给web-ui带来了几个特性:
1. web-ui的每个超参数描述都带有`--xxx`的标记,这与[命令行参数](../Instruction/命令行参数.md)的内容是一致的
2. web-ui可以在一台多卡机器上并行启动多个训练/部署任务
3. web-ui服务关闭后,后台服务是仍旧运行的,这防止了web-ui被关掉后影响训练进程,如果需要关闭后台服务,只需要**选择对应的任务**后在界面上的`运行时`tab点击杀死服务
4. 重新启动web-ui后,如果需要显示正在运行的服务,在`运行时`tab点击`找回运行时任务`即可
5. 训练界面支持显示运行日志,请在选择某个任务后手动点击`展示运行状态`,在训练时运行状态支持展示训练图表,图标包括训练loss、训练acc、学习率等基本指标,在人类对齐任务重界面图标为margin、logps等关键指标
6. web-ui的训练不支持PPO,该过程比较复杂,建议使用examples的[shell脚本](../../../examples/train/rlhf/ppo.sh)直接运行

如果需要使用share模式,请添加`--share true`参数。注意:请不要在dsw、notebook等环境中使用该参数。

目前ms-swift额外支持了界面推理模式(即Space部署):

```shell
Expand Down
7 changes: 5 additions & 2 deletions docs/source/Instruction/命令行参数.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
- 🔥stream: 流式输出,默认为`False`
- stop_words: 额外的停止词,默认为`[]`
- logprobs: 是否输出logprobs,默认为False
- top_logprobs: 默认为None

### 量化参数
以下为拉起模型时量化的参数,具体含义可以查看[量化](https://huggingface.co/docs/transformers/main/en/main_classes/quantization)文档。这里不包含`swift export`中涉及的`gptq``awq`量化参数
Expand Down Expand Up @@ -265,7 +266,7 @@ Vera使用`target_modules`, `target_regex`, `modules_to_save`三个参数.
- vision_batch_size: 默认值`1`

### vLLM参数
参数含义可以查看[vllm文档](https://docs.vllm.ai/en/latest/models/engine_args.html)
参数含义可以查看[vllm文档](https://docs.vllm.ai/en/latest/serving/engine_args.html)

- 🔥gpu_memory_utilization: 默认值`0.9`
- 🔥tensor_parallel_size: 默认为`1`
Expand All @@ -276,6 +277,7 @@ Vera使用`target_modules`, `target_regex`, `modules_to_save`三个参数.
- enforce_eager: vllm使用pytorch eager模式还是建立cuda graph. 默认为`False`. 设置为True可以节约显存, 但会影响效率.
- 🔥limit_mm_per_prompt: 控制vllm使用多图, 默认为`None`. 例如传入`--limit_mm_per_prompt '{"image": 10, "video": 5}'`
- vllm_max_lora_rank: 默认为`16`. vllm对于lora支持的参数
- enable_prefix_caching: 开启vllm的自动前缀缓存,节约重复查询前缀的处理时间。默认为`False`


### 合并参数
Expand Down Expand Up @@ -394,6 +396,7 @@ App参数继承于[部署参数](#部署参数), [Web-UI参数](#Web-UI参数)
- 🔥eval_dataset: 评测数据集,请查看[评测文档](./评测.md)
- eval_limit: 每个评测集的采样数,默认为None
- eval_output_dir: 评测存储结果的文件夹,默认为'eval_output'
- local_dataset: 部分评测集,如`CMB`无法直接运行,需要下载额外数据包才可以使用。设置本参数为`true`可以自动下载全量数据包,并在当前目录下创建`data`文件夹并开始评测。该参数默认为`false`。注意:该参数有一个副作用,默认评测会使用`~/.cache/opencompass`下的数据集,在指定本参数后会直接使用当前目录下的data文件夹。数据包仅会下载一次,后续会使用缓存。
- temperature: 默认为0.
- verbose: 该参数在本地评估时传入DeployArguments中,默认`False`
- eval_num_proc: 评测时客户端最大并发数,文本评测默认256,多模态默认16
Expand All @@ -406,7 +409,7 @@ App参数继承于[部署参数](#部署参数), [Web-UI参数](#Web-UI参数)
- 🔥output_dir: 导出结果存储路径,默认为None

- 🔥quant_method: 可选为'gptq', 'awq',默认为None
- quant_n_samples: gptq/awq的校验集抽样数,默认为128
- quant_n_samples: gptq/awq的校验集抽样数,默认为256
- max_length: 校准集的max_length, 默认值2048
- quant_batch_size: 量化batch_size,默认为1
- group_size: 量化group大小,默认为128
Expand Down
14 changes: 14 additions & 0 deletions docs/source/Instruction/支持的模型和数据集.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@
|[deepseek-ai/DeepSeek-V2.5-1210](https://modelscope.cn/models/deepseek-ai/DeepSeek-V2.5-1210)|deepseek_v2_5|deepseek_v2_5|transformers>=4.39.3|-|[deepseek-ai/DeepSeek-V2.5-1210](https://huggingface.co/deepseek-ai/DeepSeek-V2.5-1210)|
|[deepseek-ai/DeepSeek-V3-Base](https://modelscope.cn/models/deepseek-ai/DeepSeek-V3-Base)|deepseek_v2_5|deepseek_v2_5|transformers>=4.39.3|-|[deepseek-ai/DeepSeek-V3-Base](https://huggingface.co/deepseek-ai/DeepSeek-V3-Base)|
|[deepseek-ai/DeepSeek-V3](https://modelscope.cn/models/deepseek-ai/DeepSeek-V3)|deepseek_v2_5|deepseek_v2_5|transformers>=4.39.3|-|[deepseek-ai/DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3)|
|[deepseek-ai/DeepSeek-R1](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1)|deepseek_r1|deepseek_r1|transformers>=4.39.3|-|[deepseek-ai/DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1)|
|[deepseek-ai/DeepSeek-R1-Zero](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Zero)|deepseek_r1|deepseek_r1|transformers>=4.39.3|-|[deepseek-ai/DeepSeek-R1-Zero](https://huggingface.co/deepseek-ai/DeepSeek-R1-Zero)|
|[deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B)|deepseek_r1_distill|deepseek_r1|transformers>=4.37|-|[deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B)|
|[deepseek-ai/DeepSeek-R1-Distill-Qwen-7B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B)|deepseek_r1_distill|deepseek_r1|transformers>=4.37|-|[deepseek-ai/DeepSeek-R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B)|
|[deepseek-ai/DeepSeek-R1-Distill-Qwen-14B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B)|deepseek_r1_distill|deepseek_r1|transformers>=4.37|-|[deepseek-ai/DeepSeek-R1-Distill-Qwen-14B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B)|
|[deepseek-ai/DeepSeek-R1-Distill-Qwen-32B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B)|deepseek_r1_distill|deepseek_r1|transformers>=4.37|-|[deepseek-ai/DeepSeek-R1-Distill-Qwen-32B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B)|
|[deepseek-ai/DeepSeek-R1-Distill-Llama-8B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Llama-8B)|deepseek_r1_distill|deepseek_r1|-|-|[deepseek-ai/DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B)|
|[deepseek-ai/DeepSeek-R1-Distill-Llama-70B](https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Llama-70B)|deepseek_r1_distill|deepseek_r1|-|-|[deepseek-ai/DeepSeek-R1-Distill-Llama-70B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-70B)|
|[OpenBuddy/openbuddy-llama-65b-v8-bf16](https://modelscope.cn/models/OpenBuddy/openbuddy-llama-65b-v8-bf16)|openbuddy_llama|openbuddy|-|-|[OpenBuddy/openbuddy-llama-65b-v8-bf16](https://huggingface.co/OpenBuddy/openbuddy-llama-65b-v8-bf16)|
|[OpenBuddy/openbuddy-llama2-13b-v8.1-fp16](https://modelscope.cn/models/OpenBuddy/openbuddy-llama2-13b-v8.1-fp16)|openbuddy_llama|openbuddy|-|-|[OpenBuddy/openbuddy-llama2-13b-v8.1-fp16](https://huggingface.co/OpenBuddy/openbuddy-llama2-13b-v8.1-fp16)|
|[OpenBuddy/openbuddy-llama2-70b-v10.1-bf16](https://modelscope.cn/models/OpenBuddy/openbuddy-llama2-70b-v10.1-bf16)|openbuddy_llama|openbuddy|-|-|[OpenBuddy/openbuddy-llama2-70b-v10.1-bf16](https://huggingface.co/OpenBuddy/openbuddy-llama2-70b-v10.1-bf16)|
Expand Down Expand Up @@ -415,6 +423,7 @@
|[LLM-Research/Phi-3.5-mini-instruct](https://modelscope.cn/models/LLM-Research/Phi-3.5-mini-instruct)|phi3|phi3|transformers>=4.36|-|[microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct)|
|[LLM-Research/Phi-3.5-MoE-instruct](https://modelscope.cn/models/LLM-Research/Phi-3.5-MoE-instruct)|phi3_moe|phi3|transformers>=4.36|-|[microsoft/Phi-3.5-MoE-instruct](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct)|
|[LLM-Research/phi-4](https://modelscope.cn/models/LLM-Research/phi-4)|phi4|phi4|transformers>=4.36|-|[microsoft/phi-4](https://huggingface.co/microsoft/phi-4)|
|[MiniMaxAI/MiniMax-Text-01](https://modelscope.cn/models/MiniMaxAI/MiniMax-Text-01)|minimax|minimax|-|-|[MiniMaxAI/MiniMax-Text-01](https://huggingface.co/MiniMaxAI/MiniMax-Text-01)|
|[AI-ModelScope/gemma-2b-it](https://modelscope.cn/models/AI-ModelScope/gemma-2b-it)|gemma|gemma|transformers>=4.38|-|[google/gemma-2b-it](https://huggingface.co/google/gemma-2b-it)|
|[AI-ModelScope/gemma-2b](https://modelscope.cn/models/AI-ModelScope/gemma-2b)|gemma|gemma|transformers>=4.38|-|[google/gemma-2b](https://huggingface.co/google/gemma-2b)|
|[AI-ModelScope/gemma-7b](https://modelscope.cn/models/AI-ModelScope/gemma-7b)|gemma|gemma|transformers>=4.38|-|[google/gemma-7b](https://huggingface.co/google/gemma-7b)|
Expand Down Expand Up @@ -610,6 +619,7 @@
|[OpenBMB/MiniCPM-Llama3-V-2_5](https://modelscope.cn/models/OpenBMB/MiniCPM-Llama3-V-2_5)|minicpmv2_5|minicpmv2_5|timm, transformers>=4.36|vision|[openbmb/MiniCPM-Llama3-V-2_5](https://huggingface.co/openbmb/MiniCPM-Llama3-V-2_5)|
|[OpenBMB/MiniCPM-V-2_6](https://modelscope.cn/models/OpenBMB/MiniCPM-V-2_6)|minicpmv2_6|minicpmv2_6|timm, transformers>=4.36, decord|vision, video|[openbmb/MiniCPM-V-2_6](https://huggingface.co/openbmb/MiniCPM-V-2_6)|
|[OpenBMB/MiniCPM-o-2_6](https://modelscope.cn/models/OpenBMB/MiniCPM-o-2_6)|minicpmo2_6|minicpmo2_6|timm, transformers>=4.36, decord, soundfile|vision, video, omni, audio|[openbmb/MiniCPM-o-2_6](https://huggingface.co/openbmb/MiniCPM-o-2_6)|
|[MiniMaxAI/MiniMax-VL-01](https://modelscope.cn/models/MiniMaxAI/MiniMax-VL-01)|minimax_vl|minimax_vl|-|-|[MiniMaxAI/MiniMax-VL-01](https://huggingface.co/MiniMaxAI/MiniMax-VL-01)|
|[iic/mPLUG-Owl2](https://modelscope.cn/models/iic/mPLUG-Owl2)|mplug_owl2|mplug_owl2|transformers<4.35, icecream|vision|[MAGAer13/mplug-owl2-llama2-7b](https://huggingface.co/MAGAer13/mplug-owl2-llama2-7b)|
|[iic/mPLUG-Owl2.1](https://modelscope.cn/models/iic/mPLUG-Owl2.1)|mplug_owl2_1|mplug_owl2|transformers<4.35, icecream|vision|[Mizukiluke/mplug_owl_2_1](https://huggingface.co/Mizukiluke/mplug_owl_2_1)|
|[iic/mPLUG-Owl3-1B-241014](https://modelscope.cn/models/iic/mPLUG-Owl3-1B-241014)|mplug_owl3|mplug_owl3|transformers>=4.36, icecream, decord|vision, video|[mPLUG/mPLUG-Owl3-1B-241014](https://huggingface.co/mPLUG/mPLUG-Owl3-1B-241014)|
Expand Down Expand Up @@ -704,6 +714,7 @@
|[AI-ModelScope/lawyer_llama_data](https://modelscope.cn/datasets/AI-ModelScope/lawyer_llama_data)|default|21476|224.4±83.9, min=69, max=832|chat, law|[Skepsun/lawyer_llama_data](https://huggingface.co/datasets/Skepsun/lawyer_llama_data)|
|[AI-ModelScope/leetcode-solutions-python](https://modelscope.cn/datasets/AI-ModelScope/leetcode-solutions-python)|default|2359|723.8±233.5, min=259, max=2117|chat, coding, 🔥|-|
|[AI-ModelScope/lmsys-chat-1m](https://modelscope.cn/datasets/AI-ModelScope/lmsys-chat-1m)|default|166211|545.8±3272.8, min=22, max=219116|chat, em|[lmsys/lmsys-chat-1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m)|
|[AI-ModelScope/math-trn-format](https://modelscope.cn/datasets/AI-ModelScope/math-trn-format)|default|11500|102.2±88.9, min=36, max=1683|math|-|
|[AI-ModelScope/ms_agent_for_agentfabric](https://modelscope.cn/datasets/AI-ModelScope/ms_agent_for_agentfabric)|default<br>addition|30000|615.7±198.7, min=251, max=2055|chat, agent, multi-round, 🔥|-|
|[AI-ModelScope/orpo-dpo-mix-40k](https://modelscope.cn/datasets/AI-ModelScope/orpo-dpo-mix-40k)|default|43666|938.1±694.2, min=36, max=8483|dpo, orpo, en, quality|[mlabonne/orpo-dpo-mix-40k](https://huggingface.co/datasets/mlabonne/orpo-dpo-mix-40k)|
|[AI-ModelScope/pile](https://modelscope.cn/datasets/AI-ModelScope/pile)|default|huge dataset|-|pretrain|[EleutherAI/pile](https://huggingface.co/datasets/EleutherAI/pile)|
Expand Down Expand Up @@ -761,6 +772,7 @@
|[modelscope/chinese-poetry-collection](https://modelscope.cn/datasets/modelscope/chinese-poetry-collection)|default|1710|58.1±8.1, min=31, max=71|text-generation, poetry|-|
|[modelscope/clue](https://modelscope.cn/datasets/modelscope/clue)|cmnli|391783|81.6±16.0, min=54, max=157|text-generation, classification|[clue](https://huggingface.co/datasets/clue)|
|[modelscope/coco_2014_caption](https://modelscope.cn/datasets/modelscope/coco_2014_caption)|train<br>validation|454617|389.6±68.4, min=70, max=587|chat, multi-modal, vision, 🔥|-|
|[modelscope/gsm8k](https://modelscope.cn/datasets/modelscope/gsm8k)|main|7473|88.6±21.6, min=41, max=241|qa, math|-|
|[shenweizhou/alpha-umi-toolbench-processed-v2](https://modelscope.cn/datasets/shenweizhou/alpha-umi-toolbench-processed-v2)|backbone<br>caller<br>planner<br>summarizer|huge dataset|-|chat, agent, 🔥|-|
|[simpleai/HC3](https://modelscope.cn/datasets/simpleai/HC3)|finance<br>finance_cls<br>medicine<br>medicine_cls|11021|296.0±153.3, min=65, max=2267|text-generation, classification, 🔥|[Hello-SimpleAI/HC3](https://huggingface.co/datasets/Hello-SimpleAI/HC3)|
|[simpleai/HC3-Chinese](https://modelscope.cn/datasets/simpleai/HC3-Chinese)|baike<br>baike_cls<br>open_qa<br>open_qa_cls<br>nlpcc_dbqa<br>nlpcc_dbqa_cls<br>finance<br>finance_cls<br>medicine<br>medicine_cls<br>law<br>law_cls<br>psychology<br>psychology_cls|39781|179.9±70.2, min=90, max=1070|text-generation, classification, 🔥|[Hello-SimpleAI/HC3-Chinese](https://huggingface.co/datasets/Hello-SimpleAI/HC3-Chinese)|
Expand Down Expand Up @@ -816,6 +828,8 @@
|[swift/train_3.5M_CN](https://modelscope.cn/datasets/swift/train_3.5M_CN)|default|huge dataset|-|common, zh, quality|[BelleGroup/train_3.5M_CN](https://huggingface.co/datasets/BelleGroup/train_3.5M_CN)|
|[swift/ultrachat_200k](https://modelscope.cn/datasets/swift/ultrachat_200k)|default|207843|1188.0±571.1, min=170, max=4068|chat, en, quality|[HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)|
|[swift/wikipedia](https://modelscope.cn/datasets/swift/wikipedia)|default|huge dataset|-|pretrain, quality|[wikipedia](https://huggingface.co/datasets/wikipedia)|
|[tany0699/garbage265](https://modelscope.cn/datasets/tany0699/garbage265)|default|132673|39.0±0.0, min=39, max=39|cls, 🔥, multi-modal|-|
|[tastelikefeet/competition_math](https://modelscope.cn/datasets/tastelikefeet/competition_math)|default|12000|101.9±87.3, min=36, max=1683|qa, math|-|
|-|default|huge dataset|-|pretrain, quality|[tiiuae/falcon-refinedweb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)|
|[wyj123456/GPT4all](https://modelscope.cn/datasets/wyj123456/GPT4all)|default|806199|97.3±20.9, min=62, max=414|chat, general|-|
|[wyj123456/code_alpaca_en](https://modelscope.cn/datasets/wyj123456/code_alpaca_en)|default|20022|99.3±57.6, min=30, max=857|chat, coding|[sahil2801/CodeAlpaca-20k](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k)|
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Instruction/预训练及微调.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## 预训练

预训练的example请参考[这里](https://github.com/modelscope/swift/blob/main/examples/train/pt/train.sh)
预训练的example请参考[这里](https://github.com/modelscope/swift/blob/main/examples/train/pretrain/train.sh)

如果使用多机多卡预训练,请参考[这里](https://github.com/modelscope/swift/blob/main/examples/train/multi-node)

Expand Down
18 changes: 18 additions & 0 deletions docs/source_en/GetStarted/Web-UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ swift web-ui --lang zh/en

to start the interface for training and inference.

SWIFT web-ui is a high-level wrapper for the command line. In other words, tasks such as training and deployment initiated through the interface will start an independent process in the system via the command line. Pseudo-code is similar to:

```python
import os
os.system('swift sft --model xxx --dataset xxx')
```

This provides several features for the web-ui:

1. Each hyperparameter description in the web-ui is prefixed with `--xxx`, consistent with the [command line arguments](../Instruction/Command-line-parameters.md).
2. The web-ui can concurrently start multiple training/deployment tasks on a multi-GPU machine.
3. After the web-ui service is closed, the background services continue to run. This prevents the training processes from being affected when the web-ui is shut down. If you need to terminate background services, simply **select the corresponding task** and click the kill service button in the `Runtime` tab on the interface.
4. After restarting the web-ui, if you need to display the running services, click `Recover Runtime Tasks` in the `Runtime` tab.
5. The training interface supports displaying runtime logs. After selecting a specific task, manually click `Show Runtime Status`. During training, the runtime status can display training charts, including basic metrics such as training loss, training accuracy, and learning rate. In the human alignment task interface, the charts display key metrics like margin and logps.
6. Training through the web-ui does not support PPO, as the process is more complex. It is recommended to use the [shell script](../../../examples/train/rlhf/ppo.sh) in the examples directory to run it directly.

If you need to use share mode, please add the `--share true` parameter. **Note:** Do not use this parameter in environments such as dsw or notebooks.

Additionally, ms-swift supports interface inference mode (i.e., Space deployment):

```shell
Expand Down
Loading

0 comments on commit e77044a

Please sign in to comment.