Skip to content

Commit

Permalink
update docs (#3131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang authored Feb 16, 2025
1 parent fba77f5 commit 49eb131
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/Customization/自定义数据集.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ query-response格式:
{"messages": [{"role": "system", "content": "你是个有用无害的数学计算器"}, {"role": "user", "content": "1+1等于几"}, {"role": "assistant", "content": "等于2"}, {"role": "user", "content": "再加1呢"}]}
{"messages": [{"role": "user", "content": "你的名字是什么"}]}
```
- 注意:GRPO会透传所有额外的字段内容给ORM,而不像其他训练方法,默认将额外的字段删除。例如: 你可以额外传入'solution'。
- 注意:GRPO会透传所有额外的字段内容给ORM,而不像其他训练方法,默认将额外的字段删除。例如: 你可以额外传入'solution'。自定义的ORM需要包含一个位置参数completions,其他为关键词参数,由数据集额外字段透传。


### 序列分类
Expand Down
1 change: 1 addition & 0 deletions docs/source/Instruction/命令行参数.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
- save_on_each_node: 默认为False。在多机训练时需要被考虑
- save_only_model: 是否只保存模型权重而不包含优化器状态,随机种子状态等内容。默认为False
- 🔥resume_from_checkpoint: 断点续训参数,传入checkpoint路径。默认为None
- 注意: resume_from_checkpoint会读取模型权重,优化器权重,随机种子,并从上次训练的steps继续开始训练。你可以指定`--resume_only_model`只读取模型权重。
- 🔥ddp_backend: 默认为None,可选为"nccl"、"gloo"、"mpi"、"ccl"、"hccl" 、"cncl"、"mccl"
- 🔥ddp_find_unused_parameters: 默认为None
- 🔥dataloader_num_workers: 默认为0
Expand Down
2 changes: 1 addition & 1 deletion docs/source_en/Customization/Custom-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The following outlines the standard dataset format for ms-swift, where the "syst
{"messages": [{"role": "system", "content": "You are a useful and harmless math calculator"}, {"role": "user", "content": "What is 1 + 1?"}, {"role": "assistant", "content": "It equals 2"}, {"role": "user", "content": "What about adding 1?"}]}
{"messages": [{"role": "user", "content": "What is your name?"}]}
```
- Note: GRPO will passthrough all additional field contents to ORM, unlike other training methods that default to removing extra fields. For example, you can additionally pass in 'solution'.
- Note: GRPO will pass through all additional field content to the ORM, unlike other training methods that, by default, delete extra fields. For example, you can additionally pass in 'solution'. The custom ORM needs to include a positional argument called `completions`, with other arguments as keyword arguments passed through from the additional dataset fields.

### Sequence Classification
```jsonl
Expand Down
1 change: 1 addition & 0 deletions docs/source_en/Instruction/Command-line-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Other important parameters:
- save_on_each_node: Default is False. Should be considered in multi-node training.
- save_only_model: Whether to save only the model weights without including optimizer state, random seed state, etc. Default is False.
- 🔥resume_from_checkpoint: Parameter for resuming training from a checkpoint, pass the checkpoint path. Default is None.
- Note: `resume_from_checkpoint` will load the model weights, optimizer weights, and random seed, and continue training from the last trained steps. You can specify `--resume_only_model` to load only the model weights.
- 🔥ddp_backend: Default is None, options include "nccl", "gloo", "mpi", "ccl", "hccl", "cncl", "mccl".
- 🔥ddp_find_unused_parameters: Default is None.
- 🔥dataloader_num_workers: Default is 0.
Expand Down
6 changes: 3 additions & 3 deletions swift/llm/model/model/stepfun.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def get_model_tokenizer_step_audio(*args, **kwargs):
if not local_repo_path:
local_repo_path = git_clone_github('https://github.com/stepfun-ai/Step-Audio.git')
sys.path.append(local_repo_path)
if not os.path.exists('speakers'):
shutil.copytree(os.path.join(local_repo_path, 'speakers'), 'speakers')
from tokenizer import StepAudioTokenizer
from tts import StepAudioTTS
encoder_path = safe_snapshot_download('stepfun-ai/Step-Audio-Tokenizer')
model, tokenizer = get_model_tokenizer_with_flash_attn(*args, **kwargs)
model.encoder = StepAudioTokenizer(encoder_path)
# from tts import StepAudioTTS
# if not os.path.exists('speakers'):
# shutil.copytree(os.path.join(local_repo_path, 'speakers'), 'speakers')
# decoder_path = safe_snapshot_download('stepfun-ai/Step-Audio-TTS-3B')
# model.decoder = StepAudioTTS(decoder_path, model.encoder)
return model, tokenizer
Expand Down

0 comments on commit 49eb131

Please sign in to comment.