Update Retrieval_based_Voice_Conversion_WebUI.ipynb
Browse files
Retrieval_based_Voice_Conversion_WebUI.ipynb
CHANGED
|
@@ -34,14 +34,14 @@
|
|
| 34 |
},
|
| 35 |
"outputs": [],
|
| 36 |
"source": [
|
| 37 |
-
"#@title
|
| 38 |
"!nvidia-smi"
|
| 39 |
]
|
| 40 |
},
|
| 41 |
{
|
| 42 |
"cell_type": "code",
|
| 43 |
"source": [
|
| 44 |
-
"#@title
|
| 45 |
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
| 46 |
"!pip3 install --upgrade setuptools wheel\n",
|
| 47 |
"!pip3 install --upgrade pip\n",
|
|
@@ -56,7 +56,7 @@
|
|
| 56 |
{
|
| 57 |
"cell_type": "code",
|
| 58 |
"source": [
|
| 59 |
-
"#@title
|
| 60 |
"\n",
|
| 61 |
"!git clone --depth=1 -b stable https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI\n",
|
| 62 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
|
@@ -71,7 +71,7 @@
|
|
| 71 |
{
|
| 72 |
"cell_type": "code",
|
| 73 |
"source": [
|
| 74 |
-
"#@title
|
| 75 |
"!git pull"
|
| 76 |
],
|
| 77 |
"metadata": {
|
|
@@ -83,7 +83,7 @@
|
|
| 83 |
{
|
| 84 |
"cell_type": "code",
|
| 85 |
"source": [
|
| 86 |
-
"#@title
|
| 87 |
"!apt -y install -qq aria2"
|
| 88 |
],
|
| 89 |
"metadata": {
|
|
@@ -95,7 +95,7 @@
|
|
| 95 |
{
|
| 96 |
"cell_type": "code",
|
| 97 |
"source": [
|
| 98 |
-
"#@title
|
| 99 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D32k.pth\n",
|
| 100 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D40k.pth\n",
|
| 101 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D48k.pth\n",
|
|
@@ -118,7 +118,7 @@
|
|
| 118 |
{
|
| 119 |
"cell_type": "code",
|
| 120 |
"source": [
|
| 121 |
-
"#@title
|
| 122 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2-人声vocals+非人声instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP2-人声vocals+非人声instrumentals.pth\n",
|
| 123 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5-主旋律人声vocals+其他instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP5-主旋律人声vocals+其他instrumentals.pth"
|
| 124 |
],
|
|
@@ -131,7 +131,7 @@
|
|
| 131 |
{
|
| 132 |
"cell_type": "code",
|
| 133 |
"source": [
|
| 134 |
-
"#@title
|
| 135 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o hubert_base.pt"
|
| 136 |
],
|
| 137 |
"metadata": {
|
|
@@ -143,7 +143,7 @@
|
|
| 143 |
{
|
| 144 |
"cell_type": "code",
|
| 145 |
"source": [
|
| 146 |
-
"#@title
|
| 147 |
"\n",
|
| 148 |
"from google.colab import drive\n",
|
| 149 |
"drive.mount('/content/drive')"
|
|
@@ -157,9 +157,9 @@
|
|
| 157 |
{
|
| 158 |
"cell_type": "code",
|
| 159 |
"source": [
|
| 160 |
-
"#@title
|
| 161 |
"\n",
|
| 162 |
-
"#@markdown
|
| 163 |
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
| 164 |
"\n",
|
| 165 |
"!mkdir -p /content/dataset\n",
|
|
@@ -174,7 +174,7 @@
|
|
| 174 |
{
|
| 175 |
"cell_type": "code",
|
| 176 |
"source": [
|
| 177 |
-
"#@title
|
| 178 |
"!ls -a /content/dataset/\n",
|
| 179 |
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
| 180 |
],
|
|
@@ -187,7 +187,7 @@
|
|
| 187 |
{
|
| 188 |
"cell_type": "code",
|
| 189 |
"source": [
|
| 190 |
-
"#@title
|
| 191 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
| 192 |
"# %load_ext tensorboard\n",
|
| 193 |
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
|
@@ -202,12 +202,12 @@
|
|
| 202 |
{
|
| 203 |
"cell_type": "code",
|
| 204 |
"source": [
|
| 205 |
-
"#@title
|
| 206 |
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
| 207 |
"\n",
|
| 208 |
-
"#@markdown
|
| 209 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 210 |
-
"#@markdown
|
| 211 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 212 |
"\n",
|
| 213 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
|
@@ -226,12 +226,12 @@
|
|
| 226 |
{
|
| 227 |
"cell_type": "code",
|
| 228 |
"source": [
|
| 229 |
-
"#@title
|
| 230 |
-
"#@markdown
|
| 231 |
"\n",
|
| 232 |
-
"#@markdown
|
| 233 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 234 |
-
"#@markdown
|
| 235 |
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
| 236 |
"\n",
|
| 237 |
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
|
@@ -251,12 +251,12 @@
|
|
| 251 |
{
|
| 252 |
"cell_type": "code",
|
| 253 |
"source": [
|
| 254 |
-
"#@title
|
| 255 |
-
"#@markdown
|
| 256 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 257 |
-
"#@markdown
|
| 258 |
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
| 259 |
-
"#@markdown
|
| 260 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
| 261 |
"\n",
|
| 262 |
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
|
@@ -270,12 +270,12 @@
|
|
| 270 |
{
|
| 271 |
"cell_type": "code",
|
| 272 |
"source": [
|
| 273 |
-
"#@title
|
| 274 |
-
"#@markdown
|
| 275 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 276 |
-
"#@markdown
|
| 277 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
| 278 |
-
"#@markdown
|
| 279 |
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
| 280 |
"\n",
|
| 281 |
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
|
@@ -291,22 +291,22 @@
|
|
| 291 |
{
|
| 292 |
"cell_type": "code",
|
| 293 |
"source": [
|
| 294 |
-
"#@title
|
| 295 |
-
"#@markdown
|
| 296 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 297 |
-
"#@markdown
|
| 298 |
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
| 299 |
-
"#@markdown
|
| 300 |
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
| 301 |
-
"#@markdown
|
| 302 |
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
| 303 |
-
"#@markdown
|
| 304 |
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
| 305 |
-
"#@markdown
|
| 306 |
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
| 307 |
-
"#@markdown
|
| 308 |
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
| 309 |
-
"#@markdown
|
| 310 |
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
| 311 |
"\n",
|
| 312 |
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n"
|
|
@@ -320,25 +320,25 @@
|
|
| 320 |
{
|
| 321 |
"cell_type": "code",
|
| 322 |
"source": [
|
| 323 |
-
"#@title
|
| 324 |
-
"#@markdown
|
| 325 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 326 |
-
"#@markdown
|
| 327 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 328 |
"\n",
|
| 329 |
-
"!echo \"
|
| 330 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
| 331 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
| 332 |
"\n",
|
| 333 |
-
"!echo \"
|
| 334 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
| 335 |
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
| 336 |
"\n",
|
| 337 |
-
"!echo \"
|
| 338 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
| 339 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
| 340 |
"\n",
|
| 341 |
-
"!echo \"
|
| 342 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
| 343 |
],
|
| 344 |
"metadata": {
|
|
@@ -350,25 +350,25 @@
|
|
| 350 |
{
|
| 351 |
"cell_type": "code",
|
| 352 |
"source": [
|
| 353 |
-
"#@title
|
| 354 |
-
"#@markdown
|
| 355 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 356 |
-
"#@markdown
|
| 357 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 358 |
"\n",
|
| 359 |
-
"!echo \"
|
| 360 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
| 361 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
| 362 |
"\n",
|
| 363 |
-
"!echo \"
|
| 364 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
| 365 |
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
| 366 |
"\n",
|
| 367 |
-
"!echo \"
|
| 368 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
| 369 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
| 370 |
"\n",
|
| 371 |
-
"!echo \"
|
| 372 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
| 373 |
],
|
| 374 |
"metadata": {
|
|
|
|
| 34 |
},
|
| 35 |
"outputs": [],
|
| 36 |
"source": [
|
| 37 |
+
"#@title View graphics card\n",
|
| 38 |
"!nvidia-smi"
|
| 39 |
]
|
| 40 |
},
|
| 41 |
{
|
| 42 |
"cell_type": "code",
|
| 43 |
"source": [
|
| 44 |
+
"#@title Install dependencies\n",
|
| 45 |
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
| 46 |
"!pip3 install --upgrade setuptools wheel\n",
|
| 47 |
"!pip3 install --upgrade pip\n",
|
|
|
|
| 56 |
{
|
| 57 |
"cell_type": "code",
|
| 58 |
"source": [
|
| 59 |
+
"#@title Clone repository\n",
|
| 60 |
"\n",
|
| 61 |
"!git clone --depth=1 -b stable https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI\n",
|
| 62 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
|
|
|
| 71 |
{
|
| 72 |
"cell_type": "code",
|
| 73 |
"source": [
|
| 74 |
+
"#@title Update the warehouse (generally no need to execute)\n",
|
| 75 |
"!git pull"
|
| 76 |
],
|
| 77 |
"metadata": {
|
|
|
|
| 83 |
{
|
| 84 |
"cell_type": "code",
|
| 85 |
"source": [
|
| 86 |
+
"#@title Install aria2\n",
|
| 87 |
"!apt -y install -qq aria2"
|
| 88 |
],
|
| 89 |
"metadata": {
|
|
|
|
| 95 |
{
|
| 96 |
"cell_type": "code",
|
| 97 |
"source": [
|
| 98 |
+
"#@title Download the base model\n",
|
| 99 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D32k.pth\n",
|
| 100 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D40k.pth\n",
|
| 101 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D48k.pth\n",
|
|
|
|
| 118 |
{
|
| 119 |
"cell_type": "code",
|
| 120 |
"source": [
|
| 121 |
+
"#@title Download the Vocal Separation Model\n",
|
| 122 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2-人声vocals+非人声instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP2-人声vocals+非人声instrumentals.pth\n",
|
| 123 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5-主旋律人声vocals+其他instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP5-主旋律人声vocals+其他instrumentals.pth"
|
| 124 |
],
|
|
|
|
| 131 |
{
|
| 132 |
"cell_type": "code",
|
| 133 |
"source": [
|
| 134 |
+
"#@title Download hubert_base\n",
|
| 135 |
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o hubert_base.pt"
|
| 136 |
],
|
| 137 |
"metadata": {
|
|
|
|
| 143 |
{
|
| 144 |
"cell_type": "code",
|
| 145 |
"source": [
|
| 146 |
+
"#@title Mount Google Drive\n",
|
| 147 |
"\n",
|
| 148 |
"from google.colab import drive\n",
|
| 149 |
"drive.mount('/content/drive')"
|
|
|
|
| 157 |
{
|
| 158 |
"cell_type": "code",
|
| 159 |
"source": [
|
| 160 |
+
"#@title Load the packaged dataset from Google Cloud Drive to /content/dataset\n",
|
| 161 |
"\n",
|
| 162 |
+
"#@markdown Data set location\n",
|
| 163 |
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
| 164 |
"\n",
|
| 165 |
"!mkdir -p /content/dataset\n",
|
|
|
|
| 174 |
{
|
| 175 |
"cell_type": "code",
|
| 176 |
"source": [
|
| 177 |
+
"#@title Rename duplicate files in the dataset \n",
|
| 178 |
"!ls -a /content/dataset/\n",
|
| 179 |
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
| 180 |
],
|
|
|
|
| 187 |
{
|
| 188 |
"cell_type": "code",
|
| 189 |
"source": [
|
| 190 |
+
"#@title start web \n",
|
| 191 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
| 192 |
"# %load_ext tensorboard\n",
|
| 193 |
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
|
|
|
| 202 |
{
|
| 203 |
"cell_type": "code",
|
| 204 |
"source": [
|
| 205 |
+
"#@title Manually back up the trained model files to Google Drive \n",
|
| 206 |
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
| 207 |
"\n",
|
| 208 |
+
"#@markdown Model name\n",
|
| 209 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 210 |
+
"#@markdown Model epoch\n",
|
| 211 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 212 |
"\n",
|
| 213 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
|
|
|
| 226 |
{
|
| 227 |
"cell_type": "code",
|
| 228 |
"source": [
|
| 229 |
+
"#@title Restore pth from Google Drive\n",
|
| 230 |
+
"#@markdown You need to check the model file name in the logs folder yourself and manually modify the file name at the end of the command below\n",
|
| 231 |
"\n",
|
| 232 |
+
"#@markdown Model name\n",
|
| 233 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 234 |
+
"#@markdown Model epoch\n",
|
| 235 |
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
| 236 |
"\n",
|
| 237 |
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
|
|
|
| 251 |
{
|
| 252 |
"cell_type": "code",
|
| 253 |
"source": [
|
| 254 |
+
"#@title Manual preprocessing (not recommended)\n",
|
| 255 |
+
"#@markdown Model name\n",
|
| 256 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 257 |
+
"#@markdown Sampling rate\n",
|
| 258 |
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
| 259 |
+
"#@markdown Number of processes used\n",
|
| 260 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
| 261 |
"\n",
|
| 262 |
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
|
|
|
| 270 |
{
|
| 271 |
"cell_type": "code",
|
| 272 |
"source": [
|
| 273 |
+
"#@title Manual feature extraction (not recommended)\n",
|
| 274 |
+
"#@markdown Model name\n",
|
| 275 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 276 |
+
"#@markdown Number of processes used\n",
|
| 277 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
| 278 |
+
"#@markdown Pitch Extraction Algorithm\n",
|
| 279 |
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
| 280 |
"\n",
|
| 281 |
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
|
|
|
| 291 |
{
|
| 292 |
"cell_type": "code",
|
| 293 |
"source": [
|
| 294 |
+
"#@title Manual training (not recommended)\n",
|
| 295 |
+
"#@markdown Model name\n",
|
| 296 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 297 |
+
"#@markdown GPU used\n",
|
| 298 |
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
| 299 |
+
"#@markdown batch size\n",
|
| 300 |
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
| 301 |
+
"#@markdown Stopped epoch\n",
|
| 302 |
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
| 303 |
+
"#@markdown Save epoch interval\n",
|
| 304 |
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
| 305 |
+
"#@markdown Sampling rate\n",
|
| 306 |
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
| 307 |
+
"#@markdown Whether to cache the training set\n",
|
| 308 |
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
| 309 |
+
"#@markdown Whether to save only the latest ckpt file\n",
|
| 310 |
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
| 311 |
"\n",
|
| 312 |
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n"
|
|
|
|
| 320 |
{
|
| 321 |
"cell_type": "code",
|
| 322 |
"source": [
|
| 323 |
+
"#@title Delete other pths and keep only the selected ones (be careful and read the code carefully)\n",
|
| 324 |
+
"#@markdown Model name\n",
|
| 325 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 326 |
+
"#@markdown Select model epoch\n",
|
| 327 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 328 |
"\n",
|
| 329 |
+
"!echo \"Back up the selected model...\"\n",
|
| 330 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
| 331 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
| 332 |
"\n",
|
| 333 |
+
"!echo \"Deleting...\"\n",
|
| 334 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
| 335 |
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
| 336 |
"\n",
|
| 337 |
+
"!echo \"Restore the selected model...\"\n",
|
| 338 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
| 339 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
| 340 |
"\n",
|
| 341 |
+
"!echo \"Deletion completed\"\n",
|
| 342 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
| 343 |
],
|
| 344 |
"metadata": {
|
|
|
|
| 350 |
{
|
| 351 |
"cell_type": "code",
|
| 352 |
"source": [
|
| 353 |
+
"#@title Clear all files under the project and leave only the selected model (be careful and read the code carefully)\n",
|
| 354 |
+
"#@markdown Model name\n",
|
| 355 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
| 356 |
+
"#@markdown Select model epoch\n",
|
| 357 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
| 358 |
"\n",
|
| 359 |
+
"!echo \"Back up the selected model...\"\n",
|
| 360 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
| 361 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
| 362 |
"\n",
|
| 363 |
+
"!echo \"Deleting...\"\n",
|
| 364 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
| 365 |
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
| 366 |
"\n",
|
| 367 |
+
"!echo \"Restore the selected model...\"\n",
|
| 368 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
| 369 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
| 370 |
"\n",
|
| 371 |
+
"!echo \"Deletion completed\"\n",
|
| 372 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
| 373 |
],
|
| 374 |
"metadata": {
|