Spaces:
Running on Zero
Running on Zero
111
Browse files
README.md
CHANGED
|
@@ -34,6 +34,54 @@ uv pip install -r requirements.txt
|
|
| 34 |
|
| 35 |
Coming soon
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## License
|
| 38 |
|
| 39 |
The code and model weights in this project are licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), except for the following components:
|
|
|
|
| 34 |
|
| 35 |
Coming soon
|
| 36 |
|
| 37 |
+
## 推理
|
| 38 |
+
|
| 39 |
+
### 使用huggingface Space(线上体验)
|
| 40 |
+
|
| 41 |
+
访问https://huggingface.co/spaces/ASLP-lab/YingMusic-Singer之后,就可以快速体验
|
| 42 |
+
|
| 43 |
+
### 使用Docker运行
|
| 44 |
+
|
| 45 |
+
docker build -t yingmusic-singer .
|
| 46 |
+
|
| 47 |
+
### 使用python运行
|
| 48 |
+
|
| 49 |
+
git clone
|
| 50 |
+
cd
|
| 51 |
+
python initialization.py --task infer
|
| 52 |
+
|
| 53 |
+
# for Gradio
|
| 54 |
+
|
| 55 |
+
python app.py
|
| 56 |
+
|
| 57 |
+
# 多进程 Inference
|
| 58 |
+
# 1. 你需要确保所有输入模型的均为分离之后的纯人声,如果没有分离,可以参考/src/third_party/MusicSourceSeparationTraining/inference_api.py 进行分离
|
| 59 |
+
# 2. jsonl 文件的格式为,每行一个json,{}
|
| 60 |
+
python batch_infer.py \
|
| 61 |
+
--input_type jsonl \
|
| 62 |
+
--input_path /path/to/input.jsonl \
|
| 63 |
+
--output_dir /path/to/output \
|
| 64 |
+
--ckpt_path /path/to/ckpts \
|
| 65 |
+
--num_gpus 4
|
| 66 |
+
|
| 67 |
+
# 多进程 Inference(LyricEditBench melody control)
|
| 68 |
+
python inference_mp.py \
|
| 69 |
+
--input_type lyric_edit_bench_melody_control \
|
| 70 |
+
--output_dir path/to/ \
|
| 71 |
+
LyricEditBench_melody_control \
|
| 72 |
+
--ckpt_path ASLP-lab/YingMusic-Singer \
|
| 73 |
+
--num_gpus 8
|
| 74 |
+
|
| 75 |
+
# 多进程 Inference(LyricEditBench sing edit)
|
| 76 |
+
python inference_mp.py \
|
| 77 |
+
--input_type lyric_edit_bench_sing_edit \
|
| 78 |
+
--output_dir path/to/ \
|
| 79 |
+
LyricEditBench_melody_control \
|
| 80 |
+
--ckpt_path ASLP-lab/YingMusic-Singer \
|
| 81 |
+
--num_gpus 8
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
## License
|
| 86 |
|
| 87 |
The code and model weights in this project are licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), except for the following components:
|
app.py
CHANGED
|
@@ -6,24 +6,24 @@ A singing voice synthesis system powered by YingMusicSinger,
|
|
| 6 |
with built-in vocal/accompaniment separation via MelBandRoformer.
|
| 7 |
"""
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
import os
|
| 10 |
import tempfile
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
import torch
|
| 14 |
import torchaudio
|
| 15 |
-
from initialization import download_files
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
IS_HF_SPACE = os.environ.get("SPACE_ID") is not None
|
| 19 |
HF_ENABLE = False
|
| 20 |
LOCAL_DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
|
| 22 |
-
try:
|
| 23 |
-
import spaces
|
| 24 |
-
except ImportError:
|
| 25 |
-
spaces = None
|
| 26 |
-
|
| 27 |
|
| 28 |
def gpu_decorator(fn):
|
| 29 |
if IS_HF_SPACE and HF_ENABLE and spaces is not None:
|
|
|
|
| 6 |
with built-in vocal/accompaniment separation via MelBandRoformer.
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
try:
|
| 10 |
+
import spaces
|
| 11 |
+
except ImportError:
|
| 12 |
+
spaces = None
|
| 13 |
+
|
| 14 |
import os
|
| 15 |
import tempfile
|
| 16 |
|
| 17 |
import gradio as gr
|
| 18 |
import torch
|
| 19 |
import torchaudio
|
|
|
|
| 20 |
|
| 21 |
+
from initialization import download_files
|
| 22 |
|
| 23 |
IS_HF_SPACE = os.environ.get("SPACE_ID") is not None
|
| 24 |
HF_ENABLE = False
|
| 25 |
LOCAL_DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
def gpu_decorator(fn):
|
| 29 |
if IS_HF_SPACE and HF_ENABLE and spaces is not None:
|