forked from camenduru/ai-voice-cloning
fix spawning training subprocess for unixes
This commit is contained in:
parent
d5c1433268
commit
650eada8d5
|
@ -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",
|
||||
|
|
|
@ -432,15 +432,19 @@ import subprocess
|
|||
|
||||
training_process = None
|
||||
def run_training(config_path):
|
||||
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=[]
|
||||
|
|
Loading…
Reference in New Issue
Block a user