This commit is contained in:
mrq 2023-03-14 16:23:29 +00:00
parent 65fe304267
commit 9d2c7fb942

View File

@ -1048,15 +1048,19 @@ def stop_training():
training_state.killed = True training_state.killed = True
children = [] children = []
# wrapped in a try/catch in case for some reason this fails outside of Linux if args.tts_backend == "tortoise":
try: # wrapped in a try/catch in case for some reason this fails outside of Linux
children = [p.info for p in psutil.process_iter(attrs=['pid', 'name', 'cmdline']) if './src/train.py' in p.info['cmdline']] try:
except Exception as e: children = [p.info for p in psutil.process_iter(attrs=['pid', 'name', 'cmdline']) if './src/train.py' in p.info['cmdline']]
pass except Exception as e:
pass
training_state.process.stdout.close()
training_state.process.terminate()
training_state.process.kill()
elif args.tts_backend == "vall-e":
print(training_state.process.communicate(input='quit')[0])
training_state.process.stdout.close()
training_state.process.terminate()
training_state.process.kill()
return_code = training_state.process.wait() return_code = training_state.process.wait()
for p in children: for p in children: