mirror of https://github.com/coqui-ai/TTS.git
fix handling CTRL C
parent
2a20b7c2ac
commit
d95a2ce26f
2
train.py
2
train.py
|
@ -42,7 +42,7 @@ def main(args):
|
||||||
def signal_handler(signal, frame):
|
def signal_handler(signal, frame):
|
||||||
print(" !! Pressed Ctrl+C !!")
|
print(" !! Pressed Ctrl+C !!")
|
||||||
remove_experiment_folder(OUT_PATH)
|
remove_experiment_folder(OUT_PATH)
|
||||||
sys.exit(0)
|
sys.exit(1)
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
dataset = LJSpeechDataset(os.path.join(c.data_path, 'metadata.csv'),
|
dataset = LJSpeechDataset(os.path.join(c.data_path, 'metadata.csv'),
|
||||||
|
|
Binary file not shown.
|
@ -34,8 +34,9 @@ def remove_experiment_folder(experiment_path):
|
||||||
|
|
||||||
checkpoint_files = glob.glob(experiment_path+"/*.pth.tar")
|
checkpoint_files = glob.glob(experiment_path+"/*.pth.tar")
|
||||||
if len(checkpoint_files) < 1:
|
if len(checkpoint_files) < 1:
|
||||||
shutil.rmtree(experiment_path)
|
if os.path.exists(experiment_path):
|
||||||
print(" ! Run is removed from {}".format(experiment_path))
|
shutil.rmtree(experiment_path)
|
||||||
|
print(" ! Run is removed from {}".format(experiment_path))
|
||||||
else:
|
else:
|
||||||
print(" ! Run is kept in {}".format(experiment_path))
|
print(" ! Run is kept in {}".format(experiment_path))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue