From b255a77a05dda6277b72b8ca8cf2fafe88a4a558 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 17 Feb 2023 03:31:19 +0000 Subject: [PATCH] updated notebooks to use the new "main" setup --- tortoise_tts.ipynb | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/tortoise_tts.ipynb b/tortoise_tts.ipynb index 1d80b04..3f501a5 100755 --- a/tortoise_tts.ipynb +++ b/tortoise_tts.ipynb @@ -71,16 +71,29 @@ { "cell_type":"code", "source":[ - "%cd ai-voice-cloning\n", - "import src.webui as mrq\n", - "import sys\n", - "sys.argv = [\"\"]\n", + "%cd /content/ai-voice-cloning\n", "\n", - "mrq.args = mrq.setup_args()\n", - "mrq.webui = mrq.setup_gradio()\n", - "mrq.tts = mrq.setup_tortoise()\n", - "mrq.webui.launch(share=True, prevent_thread_lock=True, height=1000)\n", - "mrq.webui.block_thread()" + "import os\n", + "import sys\n", + "\n", + "sys.argv = [\"\"]\n", + "sys.path.append('./src/')\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", + "from utils import *\n", + "from webui import *\n", + "\n", + "args = setup_args()\n", + "\n", + "webui = setup_gradio()\n", + "tts = setup_tortoise()\n", + "webui.launch(share=True, prevent_thread_lock=True, height=1000)\n", + "webui.block_thread()" ], "metadata":{ "id":"c_EQZLTA19c7" @@ -102,6 +115,7 @@ { "cell_type":"code", "source":[ + "%cd /content/ai-voice-cloning\n", "!apt install -y p7zip-full\n", "from datetime import datetime\n", "timestamp = datetime.now().strftime('%m-%d-%Y_%H:%M:%S')\n",