Skip to content

Commit 56e8840

Browse files
committed
update docs
Signed-off-by: scepter914 <scepter914@gmail.com>
1 parent b3d59f4 commit 56e8840

5 files changed

Lines changed: 513 additions & 101 deletions

File tree

README.md

Lines changed: 61 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ cargo install ml-cellar
5858
```
5959

6060
<details>
61-
<summary> How to build on local device</summary>
61+
<summary> How to build on local device (If you need) </summary>
6262

6363
If you build on local device, run below command.
6464

@@ -77,6 +77,7 @@ Let's open the cellar for AI models
7777
- Start `ml-cellar`
7878

7979
```sh
80+
mkdir {your_ml_registry}
8081
cd {your_ml_registry}
8182
ml-cellar init
8283
```
@@ -105,24 +106,42 @@ use_custom_transfer_agent = false
105106

106107
If you need to handle many large files in your model registry, consider using a [Custom Transfer Agent](docs/docs_custom_transfer_agent.md) to replace the storage backend with AWS S3 or a similar service.
107108

108-
### 4. Start project
109+
### 4. Construct a rack to start ML cellar
109110

110-
A project in `ml-cellar` is like creating shelves in a wine cellar.
111-
If ML models are like wine, then project boxes are the shelves where you store the wine.
111+
A rack in `ml-cellar` is like creating racks in a wine cellar.
112+
If ML models are like wine, then racks are the shelves where you store the wine.
112113
Just as wine is labeled with its vintage year, we attach versions to AI models.
113114

114-
- Decide directory pattern for
115+
The rack consists the directory like belows:
115116

116-
Choose a directory pattern for `ml-cellar` from [the document](docs/docs_directory_pattern.md).
117-
Just as every winery has its optimal shelf arrangement, consider the directory structure that fits your team structure and what you're developing.
117+
```yaml
118+
- model_registry_repository/
119+
- vit-l/
120+
- 0.1/
121+
- config.yaml
122+
- checkpoint.pth
123+
- result.json
124+
- log.log
125+
- 0.2/
126+
- ...
127+
- 1.0/
128+
- ...
129+
- 1.1/
130+
- ...
131+
- vit-m/
132+
- ...
133+
```
134+
135+
In this directory, we call the ML model like `vit-l 1.1` for "Large size of Vision Transformer, version 1.1".
136+
It is like vintage wine called by "Dom Pérignon Vintage 2010".
118137

119-
- Start project
138+
- Make rack
120139

121140
```sh
122-
ml-cellar project {project_path}
141+
ml-cellar rack {path}
123142
```
124143

125-
- If you run `ml-cellar project my_algorithm`, then you can see as below
144+
- If you run `ml-cellar rack my_algorithm`, then you can see as below
126145

127146
```yaml
128147
- {your_ml_registry}/
@@ -133,40 +152,40 @@ ml-cellar project {project_path}
133152
```
134153

135154
- Edit project.toml
155+
- Add required files to save ML registry
156+
- If you allow to save any kind of file, you set `"*"` for optional files.
136157

137158
```toml
138-
[files]
139-
required_files = [
140-
"config.yml",
141-
"log.log",
142-
"result.json",
143-
"*.pth",
144-
]
145-
optional_files = [
146-
"*.png",
147-
"*.mp4",
148-
"*.onnx",
149-
]
150-
151-
[document]
152-
template_file = "template.md"
153-
#result_file = "result.json"
159+
[artifact]
160+
required_files = ["config.yaml", "logs/*"]
161+
optional_files = ["*"]
154162
```
155163

156-
- Edit template.md
157-
- If you want to setup template.md and result.json for MLOps, then please see [the document](docs/docs_template.md).
164+
### 5. (Option) Set up projects for MLOps
165+
166+
- Start fine-tuning for projects from base model
167+
168+
If you use fixed dataset and focus on algorithm development like Kaggle competition or research usage, the simple ML cellar is fine to share various experimental results using single rack.
158169

159-
### 5. Commit ML model
170+
However, if you are engineer and you have many projects you want to fine-tuning for, I recommend to use "project-based model registry".
171+
Please see [the document for project-based model registry](docs/project_based_model_registry.md)
160172

161-
Let's actually stock AI models on the shelves
173+
- Setup template.md and result.json for MLOps
174+
175+
If you want to setup template.md and result.json for MLOps, then please see [the document for template.md](docs/docs_template.md).
176+
177+
### 6. Commit ML model
178+
179+
Let's actually stock AI models on the racks
162180

163181
- Make branch and switch the branch
164182

165183
```sh
166184
git sw -c feat/my_algorithm/0.1
167185
```
168186

169-
- Make version directory and put files you want to commit.
187+
- Make version directory and put files you want to commit for `{your_ml_registry}/{my_algorithm}/0.1/*`.
188+
170189

171190
```yaml
172191
- {your_ml_registry}/
@@ -186,11 +205,15 @@ git sw -c feat/my_algorithm/0.1
186205
```sh
187206
ml-cellar check {path}
188207
189-
# Example
208+
```
209+
210+
- In this example, please run this command
211+
212+
```sh
190213
ml-cellar check {your_ml_registry}/{my_algorithm}/0.1/
191214
```
192215

193-
- Commit the files.
216+
- When check is fine, commit the files.
194217

195218
```sh
196219
ml-cellar commit {path} "{commit message}"
@@ -237,3 +260,8 @@ ml-cellar get {path to a directory}
237260
```sh
238261
ml-cellar get {path to a file}
239262
```
263+
264+
## Reference
265+
266+
- https://github.com/regen100/lfs-dal
267+
- https://www.regentechlog.com/2024/01/07/lfs-dal/ (Japanese blog)

docs/docs_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ When you run `ml-cellar check {path}`, `ml-cellar` adds the summary of results i
1010

1111
```toml
1212
[document]
13-
result = "result.json"
1413
template = "template.md"
14+
result = "result.json"
1515
```
1616

1717
- `template.md`

0 commit comments

Comments
 (0)