Skip to content

Commit

Permalink
Reorganize folders & better inference archs (#34)
Browse files Browse the repository at this point in the history
* move files for future archs

* remove redundent code

* organize files

* continue reorganize

* split gradio ui from inference & integrate batch inference

* fix imports

* move files to correct folder

* moved files & optimize for future archs

* move files & optimize for future archs

* fix onnx export
  • Loading branch information
leng-yue authored Mar 5, 2023
1 parent fe27e77 commit d75ea7c
Show file tree
Hide file tree
Showing 66 changed files with 1,373 additions and 1,607 deletions.
12 changes: 6 additions & 6 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,34 @@ python tools/preprocessing/extract_features.py --config configs/svc_hubert_soft.
```bash
# Single machine single card / multi-card training
python train.py --config configs/svc_hubert_soft.py
python tools/diffusion/train.py --config configs/svc_hubert_soft.py

# Resume training
python train.py --config configs/svc_hubert_soft.py --resume [checkpoint]
python tools/diffusion/train.py --config configs/svc_hubert_soft.py --resume [checkpoint]

# Fine-tune the pre-trained model
# Note: You should adjust the learning rate scheduler in the config file to warmup_cosine_finetune
python train.py --config configs/svc_cn_hubert_soft_finetune.py --pretrained [checkpoint]
python tools/diffusion/train.py --config configs/svc_cn_hubert_soft_finetune.py --pretrained [checkpoint]
```

## Inference
```bash
# Inference using shell, you can use --help to view more parameters
python inference.py --config [config] \
python tools/diffusion/inference.py --config [config] \
--checkpoint [checkpoint] \
--input [input audio] \
--output [output audio]


# Gradio Web Inference, other parameters will be used as gradio default parameters
python inference.py --config [config] \
python tools/diffusion/inference.py --config [config] \
--checkpoint [checkpoint] \
--gradio
```

## Convert a DiffSVC model to Fish Diffusion
```bash
python tools/diff_svc_converter.py --config configs/svc_hubert_soft_diff_svc.py \
python tools/diffusion/diff_svc_converter.py --config configs/svc_hubert_soft_diff_svc.py \
--input-path [DiffSVC ckpt] \
--output-path [Fish Diffusion ckpt]
```
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,34 @@ python tools/preprocessing/extract_features.py --config configs/svc_hubert_soft.
```bash
# 单机单卡 / 单机多卡训练
python train.py --config configs/svc_hubert_soft.py
python tools/diffusion/train.py --config configs/svc_hubert_soft.py

# 继续训练
python train.py --config configs/svc_hubert_soft.py --resume [checkpoint]
python tools/diffusion/train.py --config configs/svc_hubert_soft.py --resume [checkpoint]

# 微调预训练模型
# 注意: 你应该调整配置文件中的学习率调度器为 warmup_cosine_finetune
python train.py --config configs/svc_cn_hubert_soft_finetune.py --pretrained [checkpoint]
python tools/diffusion/train.py --config configs/svc_cn_hubert_soft_finetune.py --pretrained [checkpoint]
```

## 推理
```bash
# 命令行推理, 你可以使用 --help 查看更多参数
python inference.py --config [config] \
python tools/diffusion/inference.py --config [config] \
--checkpoint [checkpoint] \
--input [input audio] \
--output [output audio]


# Gradio Web 推理, 其他参数会被转为 Gradio 默认参数
python inference.py --config [config] \
python tools/diffusion/inference.py --config [config] \
--checkpoint [checkpoint] \
--gradio
```

## 将 DiffSVC 模型转换为 Fish Diffusion 模型
```bash
python tools/diff_svc_converter.py --config configs/svc_hubert_soft_diff_svc.py \
python tools/diffusion/diff_svc_converter.py --config configs/svc_hubert_soft_diff_svc.py \
--input-path [DiffSVC ckpt] \
--output-path [Fish Diffusion ckpt]
```
Expand Down
109 changes: 0 additions & 109 deletions fish_diffusion/archs/diffsinger.py

This file was deleted.

Loading

0 comments on commit d75ea7c

Please sign in to comment.