colab notebook uses venv and normal scripts to keep it on parity with a local install (and it literally just works stop creating issues for someething inconsistent with known solutions)

This commit is contained in:
mrq 2023-03-08 15:51:13 +00:00
parent 34dcb845b5
commit d58b67004a

View File

@ -38,25 +38,10 @@
], ],
"source":[ "source":[
"!apt install python3.8-venv\n",
"!git clone https://git.ecker.tech/mrq/ai-voice-cloning/\n", "!git clone https://git.ecker.tech/mrq/ai-voice-cloning/\n",
"%cd ai-voice-cloning\n", "%cd /content/ai-voice-cloning\n",
"\n", "!./setup-cuda.sh"
"!git submodule init\n",
"!git submodule update --remote\n",
"\n",
"# TODO: fix venvs working for subprocess.Popen calling a bash script\n",
"#!apt install python3.8-venv\n",
"#!python -m venv venv\n",
"#!source ./venv/bin/activate\n",
"\n",
"!python -m pip install --upgrade pip\n",
"!pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116\n",
"!python -m pip install -r ./requirements.txt\n",
"!python -m pip install -r ./tortoise-tts/requirements.txt\n",
"!python -m pip install -e ./tortoise-tts/\n",
"!python -m pip install -r ./dlas/requirements.txt\n",
"\n",
"!rm ./tortoise-tts/{main,webui}.py"
] ]
}, },
{ {
@ -120,58 +105,7 @@
{ {
"cell_type":"markdown", "cell_type":"markdown",
"source":[ "source":[
"## Running (Inlined)" "## Running"
],
"metadata":{
"id":"o1gkfw3B3JSk"
}
},
{
"cell_type":"code",
"source":[
"%cd /content/ai-voice-cloning\n",
"#!source ./venv/bin/activate\n",
"\n",
"import os\n",
"import sys\n",
"\n",
"sys.argv = [\"\"]\n",
"if './src/' not in sys.path:\n",
"\tsys.path.append('./src/')\n",
"if './tortoise-tts/' not in sys.path:\n",
"\tsys.path.append('./tortoise-tts/')\n",
"\n",
"if 'TORTOISE_MODELS_DIR' not in os.environ:\n",
"\tos.environ['TORTOISE_MODELS_DIR'] = os.path.realpath(os.path.join(os.getcwd(), './models/tortoise/'))\n",
"\n",
"if 'TRANSFORMERS_CACHE' not in os.environ:\n",
"\tos.environ['TRANSFORMERS_CACHE'] = os.path.realpath(os.path.join(os.getcwd(), './models/transformers/'))\n",
"\n",
"import utils\n",
"import webui\n",
"\n",
"args = utils.setup_args()\n",
"ui = webui.setup_gradio()\n",
"# Be very, very sure to check \"Do Not Load TTS On Startup\" in Settings after all the models download, then restart, before you start training\n",
"# You'll crash the runtime if you don't\n",
"if not args.defer_tts_load:\n",
"\tutils.setup_tortoise()\n",
"\n",
"ui.launch(share=True, prevent_thread_lock=True, height=1000)\n",
"ui.block_thread()"
],
"metadata":{
"id":"c_EQZLTA19c7"
},
"execution_count":null,
"outputs":[
]
},
{
"cell_type":"markdown",
"source":[
"## Running (non-inlined)"
], ],
"metadata":{ "metadata":{
"id":"EM3iNqgJF6Be" "id":"EM3iNqgJF6Be"
@ -203,7 +137,6 @@
{ {
"cell_type":"code", "cell_type":"code",
"source":[ "source":[
"!rm ./tortoise-tts/{main,webui}.py\n",
"exit()" "exit()"
], ],
"metadata":{ "metadata":{