Skip to content

Commit

Permalink
Update documentation with option to save model as float16 (half)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramadorArtificial committed Sep 24, 2024
1 parent 23a897e commit 14b1032
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/en/user_guides/how_to_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ For example:
python tools/misc/publish_model.py ./epoch_10.pth ./epoch_10_publish.pth
```

To save model as float16 (half) add --float16, which is as follows:

```shell
python tools/misc/publish_model.py ${IN_FILE} ${OUT_FILE} --float16
```

The script will automatically simplify the model, save the simplified model to the specified path, and add a timestamp to the filename, for example, `./epoch_10_publish-21815b2c_20230726.pth`.

## Deployment with MMDeploy
Expand Down
6 changes: 6 additions & 0 deletions docs/zh_cn/user_guides/how_to_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ python tools/misc/publish_model.py ${IN_FILE} ${OUT_FILE}
python tools/misc/publish_model.py ./epoch_10.pth ./epoch_10_publish.pth
```

要将模型保存为 float16 (half),请添加 --float16,如下所示:

```shell
python tools/misc/publish_model.py ${IN_FILE} ${OUT_FILE} --float16
```

脚本会自动对模型进行精简,并将精简后的模型保存到制定路径,并在文件名的最后加上时间戳,例如 `./epoch_10_publish-21815b2c_20230726.pth`

## 使用 MMDeploy 部署
Expand Down

0 comments on commit 14b1032

Please sign in to comment.