Skip to content

Commit 708c582

Browse files
committed
(docs): fix mcore adapter convert.
文档更新将 Megatron 模型的相关说明更改为 MCoreAdapter 模型,并明确指出转换工具适用于由 `megatron_strategy` 训练的模型。 Link: https://code.alibaba-inc.com/openlm/ScaleAligner/codereview/23069812 * (docs): fix mcore adapter convert. (cherry picked from commit 44d354363baafc9c8637f6c963696196b1dba95f)
1 parent c0c0d2b commit 708c582

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Converting Megatron Models to Hugging Face Format
1+
# Converting MCoreAdapter Models to Hugging Face Format
22

3-
MCoreAdapter provides tools for converting between Megatron and Hugging Face model formats. This document will guide you on how to convert a trained Megatron model to Hugging Face format for use in other projects.
3+
MCoreAdapter provides tools for converting between Megatron(McoreAdapter) and Hugging Face model formats. This document will guide you on how to convert a trained Megatron model to Hugging Face format for use in other projects.
44

55
## Conversion Tool
66

7-
MCoreAdapter includes a conversion tool `tools/convert.py` that can convert Megatron models to Hugging Face format.
7+
MCoreAdapter includes a conversion tool `tools/convert.py` that can convert Megatron(McoreAdapter) models to Hugging Face format.
88

99
## Conversion Command
1010

11-
To convert a Megatron model to a Hugging Face model, use the following command:
11+
To convert a model trained with megatron_strategy to a Hugging Face model, use the following command:
1212

1313
```bash
1414
python tools/convert.py --checkpoint_path path_to_megatron_model --output_path path_to_output_hf_model
1515
```
1616

1717
Where:
18-
- `path_to_megatron_model` is the path to the Megatron model you want to convert
18+
- `path_to_megatron_model` is the path to the McoreAdapter model you want to convert
1919
- `path_to_output_hf_model` is the output path for the converted Hugging Face model
2020

2121
## Notes
@@ -26,4 +26,4 @@ Where:
2626

2727
## Direct Use of Hugging Face Models
2828

29-
It's worth noting that MCoreAdapter can also directly load Hugging Face models, so in some cases you can skip the step of converting models to Megatron format. This is particularly useful when you want to use Hugging Face models in Roll framework's reinforcement learning workflows.
29+
It's worth noting that MCoreAdapter can directly load Hugging Face models without explicitly converting models to Megatron(McoreAdapter) format. This is particularly useful when you want to use Hugging Face models for reinforcement learning in the Roll framework.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Megatron 模型转换为 Hugging Face 格式
1+
# MCoreAdapter 模型转换为 Hugging Face 格式
22

3-
MCoreAdapter 提供了在 Megatron 和 Hugging Face 模型格式之间进行转换的工具。本文档将指导您如何将训练好的 Megatron 模型转换为 Hugging Face 格式,以便在其他项目中使用。
3+
MCoreAdapter 提供了在 Megatron(McoreAdapter) 和 Hugging Face 模型格式之间进行转换的工具。本文档将指导您如何将训练好的 Megatron(McoreAdapter) 模型转换为 Hugging Face 格式,以便在其他项目中使用。
44

55
## 转换工具
66

7-
MCoreAdapter 包含一个转换工具 `tools/convert.py`,可以将 Megatron 模型转换为 Hugging Face 格式。
7+
MCoreAdapter 包含一个转换工具 `tools/convert.py`,可以将 Megatron(McoreAdapter) 模型转换为 Hugging Face 格式。
88

99
## 转换命令
1010

11-
要将 Megatron 模型转换为 Hugging Face 模型,请使用以下命令:
11+
由megatron_strategy训练出来的模型,要Hugging Face 模型,请使用以下命令:
1212

1313
```bash
1414
python tools/convert.py --checkpoint_path path_to_megatron_model --output_path path_to_output_hf_model
1515
```
1616

1717
其中:
18-
- `path_to_megatron_model` 是您要转换的 Megatron 模型的路径
18+
- `path_to_megatron_model` 是您要转换的 McoreAdapter 模型的路径
1919
- `path_to_output_hf_model` 是转换后 Hugging Face 模型的输出路径
2020

2121
## 注意事项
@@ -26,4 +26,4 @@ python tools/convert.py --checkpoint_path path_to_megatron_model --output_path p
2626

2727
## 直接使用 Hugging Face 模型
2828

29-
值得注意的是,MCoreAdapter 直接加载 Hugging Face 模型,不需要显式将模型转换为 Megatron 格式的步骤。这在您想将 Hugging Face 模型用于 Roll 框架的强化学习时特别有用。
29+
值得注意的是,MCoreAdapter 直接加载 Hugging Face 模型,不需要显式将模型转换为 Megatron(McoreAdapter) 格式的步骤。这在您想将 Hugging Face 模型用于 Roll 框架的强化学习时特别有用。

0 commit comments

Comments
 (0)