Skip to content

Commit 5e42b8e

Browse files
committed
nit: resolves format issues
1 parent 7244536 commit 5e42b8e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/04-Finetune/02-Quick Start.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ We recommend that you read the corresponding [model card](../05-Model%20Card.mdx
2727
:::
2828

2929
1. Navigate to the `CogKit/` directory after cloning the repository
30+
3031
```bash
3132
cd CogKit/
3233
```
3334

34-
2. Choose the appropriate sub directory from the `quickstart/scripts` based on your task type and distribution strategy. For example, `t2i` corresponds to text-to-image task
35+
2. Choose the appropriate subdirectory from the `quickstart/scripts` based on your task type and distribution strategy. For example, `t2i` corresponds to text-to-image task
3536

3637
3. Review and adjust the parameters in `config.yaml` in the selected training directory
3738

38-
4. Run the script in selected directory:
39+
4. Run the script in the selected directory:
3940

4041
```bash
4142
bash start_train.sh
@@ -45,7 +46,9 @@ We recommend that you read the corresponding [model card](../05-Model%20Card.mdx
4546

4647
### Merge Checkpoint
4748

48-
After fine-tuning, you need to use the `merge.py` script provided in the `quickstart/tools/converters` directory to merge the distributed checkpoint weights into a single checkpoint (**except for QLoRA fine-tuning**). For example:
49+
After fine-tuning, you need to use the `merge.py` script to merge the distributed checkpoint weights into a single checkpoint (**except for QLoRA fine-tuning**).
50+
The script can be found in the `quickstart/tools/converters` directory.
51+
For example:
4952

5053
```bash
5154
cd quickstart/tools/converters

tools/converters/merge.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
#! /usr/bin/env python
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
24

35
import argparse
6+
from pathlib import Path
47

58
import torch
9+
from safetensors.torch import save_file
610
from torch.distributed.checkpoint.format_utils import dcp_to_torch_save
7-
from pathlib import Path
11+
812
from cogkit.utils.lora import _LORA_WEIGHT_NAME
9-
from safetensors.torch import save_file
1013

1114
TORCH_SAVE_CHECKPOINT_DIR = "diffusion_pytorch_model.bin"
1215

0 commit comments

Comments
 (0)