Update Retrieval_based_Voice_Conversion_WebUI_v2.ipynb
Browse files
Retrieval_based_Voice_Conversion_WebUI_v2.ipynb
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
},
|
19 |
"outputs": [],
|
20 |
"source": [
|
21 |
-
"#@title
|
22 |
"!nvidia-smi"
|
23 |
]
|
24 |
},
|
@@ -30,7 +30,7 @@
|
|
30 |
},
|
31 |
"outputs": [],
|
32 |
"source": [
|
33 |
-
"#@title
|
34 |
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
35 |
"!pip3 install --upgrade setuptools wheel\n",
|
36 |
"!pip3 install --upgrade pip\n",
|
@@ -45,7 +45,7 @@
|
|
45 |
},
|
46 |
"outputs": [],
|
47 |
"source": [
|
48 |
-
"#@title
|
49 |
"\n",
|
50 |
"!mkdir Retrieval-based-Voice-Conversion-WebUI\n",
|
51 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
@@ -63,7 +63,7 @@
|
|
63 |
},
|
64 |
"outputs": [],
|
65 |
"source": [
|
66 |
-
"#@title
|
67 |
"!git pull"
|
68 |
]
|
69 |
},
|
@@ -75,7 +75,7 @@
|
|
75 |
},
|
76 |
"outputs": [],
|
77 |
"source": [
|
78 |
-
"#@title
|
79 |
"!apt -y install -qq aria2"
|
80 |
]
|
81 |
},
|
@@ -87,7 +87,7 @@
|
|
87 |
},
|
88 |
"outputs": [],
|
89 |
"source": [
|
90 |
-
"#@title
|
91 |
"\n",
|
92 |
"# v1\n",
|
93 |
"!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",
|
@@ -126,7 +126,7 @@
|
|
126 |
},
|
127 |
"outputs": [],
|
128 |
"source": [
|
129 |
-
"#@title
|
130 |
"!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",
|
131 |
"!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"
|
132 |
]
|
@@ -139,7 +139,7 @@
|
|
139 |
},
|
140 |
"outputs": [],
|
141 |
"source": [
|
142 |
-
"#@title
|
143 |
"!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"
|
144 |
]
|
145 |
},
|
@@ -151,7 +151,7 @@
|
|
151 |
},
|
152 |
"outputs": [],
|
153 |
"source": [
|
154 |
-
"#@title
|
155 |
"\n",
|
156 |
"from google.colab import drive\n",
|
157 |
"drive.mount('/content/drive')"
|
@@ -165,9 +165,9 @@
|
|
165 |
},
|
166 |
"outputs": [],
|
167 |
"source": [
|
168 |
-
"#@title
|
169 |
"\n",
|
170 |
-
"#@markdown
|
171 |
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
172 |
"\n",
|
173 |
"!mkdir -p /content/dataset\n",
|
@@ -182,7 +182,7 @@
|
|
182 |
},
|
183 |
"outputs": [],
|
184 |
"source": [
|
185 |
-
"#@title
|
186 |
"!ls -a /content/dataset/\n",
|
187 |
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
188 |
]
|
@@ -195,7 +195,7 @@
|
|
195 |
},
|
196 |
"outputs": [],
|
197 |
"source": [
|
198 |
-
"#@title
|
199 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
200 |
"# %load_ext tensorboard\n",
|
201 |
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
@@ -210,10 +210,10 @@
|
|
210 |
},
|
211 |
"outputs": [],
|
212 |
"source": [
|
213 |
-
"#@title
|
214 |
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
215 |
"\n",
|
216 |
-
"#@markdown
|
217 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
218 |
"#@markdown 模型epoch\n",
|
219 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
@@ -234,12 +234,12 @@
|
|
234 |
},
|
235 |
"outputs": [],
|
236 |
"source": [
|
237 |
-
"#@title
|
238 |
-
"#@markdown
|
239 |
"\n",
|
240 |
-
"#@markdown
|
241 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
242 |
-
"#@markdown
|
243 |
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
244 |
"\n",
|
245 |
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
@@ -259,12 +259,12 @@
|
|
259 |
},
|
260 |
"outputs": [],
|
261 |
"source": [
|
262 |
-
"#@title
|
263 |
-
"#@markdown
|
264 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
265 |
-
"#@markdown
|
266 |
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
267 |
-
"#@markdown
|
268 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
269 |
"\n",
|
270 |
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
@@ -278,12 +278,12 @@
|
|
278 |
},
|
279 |
"outputs": [],
|
280 |
"source": [
|
281 |
-
"#@title
|
282 |
-
"#@markdown
|
283 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
284 |
-
"#@markdown
|
285 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
286 |
-
"#@markdown
|
287 |
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
288 |
"\n",
|
289 |
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
@@ -299,22 +299,22 @@
|
|
299 |
},
|
300 |
"outputs": [],
|
301 |
"source": [
|
302 |
-
"#@title
|
303 |
-
"#@markdown
|
304 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
305 |
-
"#@markdown
|
306 |
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
307 |
-
"#@markdown
|
308 |
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
309 |
-
"#@markdown
|
310 |
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
311 |
-
"#@markdown
|
312 |
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
313 |
-
"#@markdown
|
314 |
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
315 |
-
"#@markdown
|
316 |
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
317 |
-
"#@markdown
|
318 |
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
319 |
"\n",
|
320 |
"!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"
|
@@ -328,25 +328,25 @@
|
|
328 |
},
|
329 |
"outputs": [],
|
330 |
"source": [
|
331 |
-
"#@title
|
332 |
-
"#@markdown
|
333 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
334 |
-
"#@markdown
|
335 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
336 |
"\n",
|
337 |
-
"!echo \"
|
338 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
339 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
340 |
"\n",
|
341 |
-
"!echo \"
|
342 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
343 |
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
344 |
"\n",
|
345 |
-
"!echo \"
|
346 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
347 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
348 |
"\n",
|
349 |
-
"!echo \"
|
350 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
351 |
]
|
352 |
},
|
@@ -358,25 +358,25 @@
|
|
358 |
},
|
359 |
"outputs": [],
|
360 |
"source": [
|
361 |
-
"#@title
|
362 |
-
"#@markdown
|
363 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
364 |
"#@markdown 选中模型epoch\n",
|
365 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
366 |
"\n",
|
367 |
-
"!echo \"
|
368 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
369 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
370 |
"\n",
|
371 |
-
"!echo \"
|
372 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
373 |
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
374 |
"\n",
|
375 |
-
"!echo \"
|
376 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
377 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
378 |
"\n",
|
379 |
-
"!echo \"
|
380 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
381 |
]
|
382 |
}
|
|
|
18 |
},
|
19 |
"outputs": [],
|
20 |
"source": [
|
21 |
+
"#@title View graphics card\n",
|
22 |
"!nvidia-smi"
|
23 |
]
|
24 |
},
|
|
|
30 |
},
|
31 |
"outputs": [],
|
32 |
"source": [
|
33 |
+
"#@title Install dependencies\n",
|
34 |
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
35 |
"!pip3 install --upgrade setuptools wheel\n",
|
36 |
"!pip3 install --upgrade pip\n",
|
|
|
45 |
},
|
46 |
"outputs": [],
|
47 |
"source": [
|
48 |
+
"#@title Clone repository\n",
|
49 |
"\n",
|
50 |
"!mkdir Retrieval-based-Voice-Conversion-WebUI\n",
|
51 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
|
|
63 |
},
|
64 |
"outputs": [],
|
65 |
"source": [
|
66 |
+
"#@title Update the warehouse (generally no need to execute)\n",
|
67 |
"!git pull"
|
68 |
]
|
69 |
},
|
|
|
75 |
},
|
76 |
"outputs": [],
|
77 |
"source": [
|
78 |
+
"#@title Install aria2\n",
|
79 |
"!apt -y install -qq aria2"
|
80 |
]
|
81 |
},
|
|
|
87 |
},
|
88 |
"outputs": [],
|
89 |
"source": [
|
90 |
+
"#@title Download the base model\n",
|
91 |
"\n",
|
92 |
"# v1\n",
|
93 |
"!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",
|
|
|
126 |
},
|
127 |
"outputs": [],
|
128 |
"source": [
|
129 |
+
"#@title Download the Vocal Separation Model\n",
|
130 |
"!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",
|
131 |
"!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"
|
132 |
]
|
|
|
139 |
},
|
140 |
"outputs": [],
|
141 |
"source": [
|
142 |
+
"#@title Download hubert_base\n",
|
143 |
"!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"
|
144 |
]
|
145 |
},
|
|
|
151 |
},
|
152 |
"outputs": [],
|
153 |
"source": [
|
154 |
+
"#@title Mount Google Drive\n",
|
155 |
"\n",
|
156 |
"from google.colab import drive\n",
|
157 |
"drive.mount('/content/drive')"
|
|
|
165 |
},
|
166 |
"outputs": [],
|
167 |
"source": [
|
168 |
+
"#@title Load the packaged dataset from Google Cloud Drive to /content/dataset\n",
|
169 |
"\n",
|
170 |
+
"#@markdown Data set location\n",
|
171 |
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
172 |
"\n",
|
173 |
"!mkdir -p /content/dataset\n",
|
|
|
182 |
},
|
183 |
"outputs": [],
|
184 |
"source": [
|
185 |
+
"#@title Rename duplicate files in the dataset\n",
|
186 |
"!ls -a /content/dataset/\n",
|
187 |
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
188 |
]
|
|
|
195 |
},
|
196 |
"outputs": [],
|
197 |
"source": [
|
198 |
+
"#@title start web\n",
|
199 |
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
200 |
"# %load_ext tensorboard\n",
|
201 |
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
|
|
210 |
},
|
211 |
"outputs": [],
|
212 |
"source": [
|
213 |
+
"#@title Manually back up the trained model files to Google Drive\n",
|
214 |
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
215 |
"\n",
|
216 |
+
"#@markdown Model name\n",
|
217 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
218 |
"#@markdown 模型epoch\n",
|
219 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
|
|
234 |
},
|
235 |
"outputs": [],
|
236 |
"source": [
|
237 |
+
"#@title Restore pth from Google Drive\n",
|
238 |
+
"#@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",
|
239 |
"\n",
|
240 |
+
"#@markdown Model name\n",
|
241 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
242 |
+
"#@markdown Model epoch\n",
|
243 |
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
244 |
"\n",
|
245 |
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
|
|
259 |
},
|
260 |
"outputs": [],
|
261 |
"source": [
|
262 |
+
"#@title Manual preprocessing (not recommended)\n",
|
263 |
+
"#@markdown Model name\n",
|
264 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
265 |
+
"#@markdown Sampling rate\n",
|
266 |
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
267 |
+
"#@markdown Number of processes used\n",
|
268 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
269 |
"\n",
|
270 |
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
|
|
278 |
},
|
279 |
"outputs": [],
|
280 |
"source": [
|
281 |
+
"#@title Manual feature extraction (not recommended)\n",
|
282 |
+
"#@markdown Model name\n",
|
283 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
284 |
+
"#@markdown Number of processes used\n",
|
285 |
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
286 |
+
"#@markdown Pitch Extraction Algorithm\n",
|
287 |
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
288 |
"\n",
|
289 |
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
|
|
299 |
},
|
300 |
"outputs": [],
|
301 |
"source": [
|
302 |
+
"#@title Manual training (not recommended)\n",
|
303 |
+
"#@markdown Model name\n",
|
304 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
305 |
+
"#@markdown GPU used\n",
|
306 |
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
307 |
+
"#@markdown batch size\n",
|
308 |
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
309 |
+
"#@markdown Stopped epoch\n",
|
310 |
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
311 |
+
"#@markdown Save epoch interval\n",
|
312 |
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
313 |
+
"#@markdown Sampling rate\n",
|
314 |
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
315 |
+
"#@markdown Whether to cache the training set\n",
|
316 |
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
317 |
+
"#@markdown Whether to save only the latest ckpt file\n",
|
318 |
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
319 |
"\n",
|
320 |
"!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"
|
|
|
328 |
},
|
329 |
"outputs": [],
|
330 |
"source": [
|
331 |
+
"#@title Delete other pths and keep only the selected ones (be careful and read the code carefully)\n",
|
332 |
+
"#@markdown Model name\n",
|
333 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
334 |
+
"#@markdown Select model epoch\n",
|
335 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
336 |
"\n",
|
337 |
+
"!echo \"Back up the selected model...\"\n",
|
338 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
339 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
340 |
"\n",
|
341 |
+
"!echo \"Deleting...\"\n",
|
342 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
343 |
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
344 |
"\n",
|
345 |
+
"!echo \"Restore the selected model...\"\n",
|
346 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
347 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
348 |
"\n",
|
349 |
+
"!echo \"Deletion completed\"\n",
|
350 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
351 |
]
|
352 |
},
|
|
|
358 |
},
|
359 |
"outputs": [],
|
360 |
"source": [
|
361 |
+
"#@title Clear all files under the project and leave only the selected model (be careful and read the code carefully)\n",
|
362 |
+
"#@markdown Model name\n",
|
363 |
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
364 |
"#@markdown 选中模型epoch\n",
|
365 |
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
366 |
"\n",
|
367 |
+
"!echo \"Back up the selected model...\"\n",
|
368 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
369 |
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
370 |
"\n",
|
371 |
+
"!echo \"Deleting...\"\n",
|
372 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
373 |
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
374 |
"\n",
|
375 |
+
"!echo \"Restore the selected model...\"\n",
|
376 |
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
377 |
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
378 |
"\n",
|
379 |
+
"!echo \"Deletion completed\"\n",
|
380 |
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
381 |
]
|
382 |
}
|