From 650eada8d505b9d1decf0d1c070112b401824455 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 18 Feb 2023 02:40:30 +0000 Subject: [PATCH] fix spawning training subprocess for unixes --- notebook.ipynb | 4 +--- src/utils.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/notebook.ipynb b/notebook.ipynb index b5de8af..6569fcd 100755 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -64,8 +64,7 @@ "!git pull\n", "%cd ..\n", "!git reset --hard HEAD\n", - "!git pull\n", - "!python -m pip install ffmpeg ffmpeg-python" + "!git pull\n" ], "metadata":{ "id":"3DktoOXSHmtw" @@ -115,7 +114,6 @@ "cell_type":"code", "source":[ "%cd /content/ai-voice-cloning\n", - "!python -m venv venv\n", "!source ./venv/bin/activate\n", "\n", "import os\n", diff --git a/src/utils.py b/src/utils.py index b391075..f03dbcd 100755 --- a/src/utils.py +++ b/src/utils.py @@ -432,15 +432,19 @@ import subprocess training_process = None def run_training(config_path): - print("Unloading TTS to save VRAM.") - global tts - del tts - tts = None + try: + print("Unloading TTS to save VRAM.") + global tts + del tts + tts = None + except Exception as e: + pass global training_process torch.multiprocessing.freeze_support() - cmd = [f'train.{"bat" if args.os == "windows" else "sh"}', config_path] + cmd = ['call' '.\\train.bat', config_path] if os.name == "nt" else ['bash', './train.sh', config_path] + print("Spawning process: ", " ".join(cmd)) training_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) buffer=[]