Updated notebook to put userdata under a dedicated folder (and some safeties to not nuke them if you double run the script like I did thinking rm -r [symlink] would just remove the symlink

This commit is contained in:
mrq 2023-02-22 15:45:41 +00:00
parent 526a430c2a
commit aa96edde2f

View File

@ -96,21 +96,18 @@
"cell_type":"code", "cell_type":"code",
"source":[ "source":[
"# only run once, this will save all userdata to your Drive\n", "# only run once, this will save all userdata to your Drive\n",
"# it shouldn't delete through symlinks, but you never know\n",
"\n",
"from google.colab import drive\n", "from google.colab import drive\n",
"drive.mount('/content/drive')\n",
"\n", "\n",
"%cd /content/ai-voice-cloning\n", "%cd /content/ai-voice-cloning\n",
"!rm -r ./training\n", "drive.flush_and_unmount()\n",
"!rm -r ./results\n", "!rm -r ./{training,results,voices,config}\n",
"!rm -r ./voices\n", "drive.mount('/content/drive')\n",
"\n", "!mkdir /content/drive/MyDrive/ai-voice-cloning/\n",
"!mkdir /content/drive/MyDrive/training/\n", "!mv /content/drive/MyDrive/{training,results,voices,config} /content/drive/MyDrive/ai-voice-cloning\n",
"!mkdir /content/drive/MyDrive/results/\n", "!mkdir /content/drive/MyDrive/ai-voice-cloning/{training,results,voices,config}\n",
"!mkdir /content/drive/MyDrive/voices/\n", "!ln -s /content/drive/MyDrive/ai-voice-cloning/{training,results,voices,config} /content/drive/MyDrive/ai-voice-cloning/"
"\n",
"!ln -s /content/drive/MyDrive/training/\n",
"!ln -s /content/drive/MyDrive/results/\n",
"!ln -s /content/drive/MyDrive/voices/"
], ],
"metadata":{ "metadata":{
"id":"SGt9gyvubveT" "id":"SGt9gyvubveT"
@ -253,6 +250,7 @@
{ {
"cell_type":"code", "cell_type":"code",
"source":[ "source":[
"# if you're not using drive mounting\n",
"%cd /content/ai-voice-cloning\n", "%cd /content/ai-voice-cloning\n",
"!apt install -y p7zip-full\n", "!apt install -y p7zip-full\n",
"from datetime import datetime\n", "from datetime import datetime\n",