mirror of https://github.com/coqui-ai/TTS.git
Allow debug runand don force git hash
This commit is contained in:
parent
d4bfb0e31c
commit
247cfdd923
4
train.py
4
train.py
|
@ -36,13 +36,15 @@ parser.add_argument('--restore_path', type=str,
|
||||||
help='Folder path to checkpoints', default=0)
|
help='Folder path to checkpoints', default=0)
|
||||||
parser.add_argument('--config_path', type=str,
|
parser.add_argument('--config_path', type=str,
|
||||||
help='path to config file for training',)
|
help='path to config file for training',)
|
||||||
|
parser.add_argument('--debug', type=bool, default=False,
|
||||||
|
help='do not ask for git has before run.')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# setup output paths and read configs
|
# setup output paths and read configs
|
||||||
c = load_config(args.config_path)
|
c = load_config(args.config_path)
|
||||||
_ = os.path.dirname(os.path.realpath(__file__))
|
_ = os.path.dirname(os.path.realpath(__file__))
|
||||||
OUT_PATH = os.path.join(_, c.output_path)
|
OUT_PATH = os.path.join(_, c.output_path)
|
||||||
OUT_PATH = create_experiment_folder(OUT_PATH, c.model_name)
|
OUT_PATH = create_experiment_folder(OUT_PATH, c.model_name, args.debug)
|
||||||
CHECKPOINT_PATH = os.path.join(OUT_PATH, 'checkpoints')
|
CHECKPOINT_PATH = os.path.join(OUT_PATH, 'checkpoints')
|
||||||
shutil.copyfile(args.config_path, os.path.join(OUT_PATH, 'config.json'))
|
shutil.copyfile(args.config_path, os.path.join(OUT_PATH, 'config.json'))
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,13 @@ def get_commit_hash():
|
||||||
return commit
|
return commit
|
||||||
|
|
||||||
|
|
||||||
def create_experiment_folder(root_path, model_name):
|
def create_experiment_folder(root_path, model_name, debug):
|
||||||
""" Create a folder with the current date and time """
|
""" Create a folder with the current date and time """
|
||||||
date_str = datetime.datetime.now().strftime("%B-%d-%Y_%I:%M%p")
|
date_str = datetime.datetime.now().strftime("%B-%d-%Y_%I:%M%p")
|
||||||
commit_hash = get_commit_hash()
|
if debug:
|
||||||
|
commit_hash = 'debug'
|
||||||
|
else:
|
||||||
|
commit_hash = get_commit_hash()
|
||||||
output_folder = os.path.join(root_path, date_str + '-' + model_name + '-' + commit_hash)
|
output_folder = os.path.join(root_path, date_str + '-' + model_name + '-' + commit_hash)
|
||||||
os.makedirs(output_folder, exist_ok=True)
|
os.makedirs(output_folder, exist_ok=True)
|
||||||
print(" > Experiment folder: {}".format(output_folder))
|
print(" > Experiment folder: {}".format(output_folder))
|
||||||
|
|
Loading…
Reference in New Issue