Skip to content

Commit 6b0d5a5

Browse files
authored
[Docs] Add README for examples (open-mmlab#1295)
1 parent 398d229 commit 6b0d5a5

File tree

8 files changed

+76
-6
lines changed

8 files changed

+76
-6
lines changed

.pre-commit-config-zh-cn.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ repos:
5858
rev: v0.812
5959
hooks:
6060
- id: mypy
61-
exclude: "docs"
61+
exclude: |-
62+
(?x)(
63+
^examples
64+
| ^docs
65+
)

.pre-commit-config.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ repos:
5858
rev: v0.812
5959
hooks:
6060
- id: mypy
61-
exclude: "docs"
61+
exclude: |-
62+
(?x)(
63+
^examples
64+
| ^docs
65+
)

examples/segmentation/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ odl get CamVid -d data
2020
tar -xzvf data/CamVid/raw/CamVid.tar.gz.00 -C ./data
2121
```
2222

23-
## Run the example
23+
## Run the Example
2424

2525
Single device training
2626

2727
```bash
28-
python examples/segmentation/segmentation_training.py
28+
python examples/segmentation/train.py
2929
```
3030

3131
Distributed data parallel training
3232

3333
```bash
34-
tochrun -nnodes 1 -nproc_per_node 8 examples/segmentation/segmentation_training.py --launcher pytorch
34+
tochrun -nnodes 1 -nproc_per_node 8 examples/segmentation/train.py --launcher pytorch
3535
```

examples/segmentation/train.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Segmentation Task Example\n",
7+
"# Train a Segmentation Model\n",
88
"\n",
99
"This segmentation task example will be divided into the following steps:\n",
1010
"\n",
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Train a Text Classification Model
2+
3+
## Install Dependencies
4+
5+
- Build MMEngine from Source
6+
7+
```bash
8+
git clone https://github.com/open-mmlab/mmengine.git
9+
cd mmengine
10+
pip install -e . -v
11+
```
12+
13+
- Install thirty-party libraries
14+
15+
```bash
16+
pip install datasets transformers
17+
```
18+
19+
## Run the Example
20+
21+
- Single device training
22+
23+
```bash
24+
python examples/text_classification/train.py
25+
```
26+
27+
- Distributed data parallel training
28+
29+
```bash
30+
tochrun -nnodes 1 -nproc_per_node 8 examples/text_classification/train.py --launcher pytorch
31+
```

examples/text_translation/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Train a Text Translation Model
2+
3+
## Install Dependencies
4+
5+
- Build MMEngine from Source
6+
7+
```bash
8+
git clone https://github.com/open-mmlab/mmengine.git
9+
cd mmengine
10+
pip install -e . -v
11+
```
12+
13+
- Install thirty-party libraries
14+
15+
```bash
16+
pip install datasets transformers torchtext
17+
```
18+
19+
## Run the Example
20+
21+
- Single device training
22+
23+
```bash
24+
python examples/text_translation/train.py
25+
```
26+
27+
- Distributed data parallel training
28+
29+
```bash
30+
tochrun -nnodes 1 -nproc_per_node 8 examples/text_translation/train.py --launcher pytorch
31+
```
File renamed without changes.

0 commit comments

Comments
 (0)