keithhon commited on
Commit
a23cbcc
1 Parent(s): 38eae51

Upload synthesizer_train.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. synthesizer_train.py +35 -0
synthesizer_train.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from synthesizer.hparams import hparams
2
+ from synthesizer.train import train
3
+ from utils.argutils import print_args
4
+ import argparse
5
+
6
+
7
+ if __name__ == "__main__":
8
+ parser = argparse.ArgumentParser()
9
+ parser.add_argument("run_id", type=str, help= \
10
+ "Name for this model instance. If a model state from the same run ID was previously "
11
+ "saved, the training will restart from there. Pass -f to overwrite saved states and "
12
+ "restart from scratch.")
13
+ parser.add_argument("syn_dir", type=str, default=argparse.SUPPRESS, help= \
14
+ "Path to the synthesizer directory that contains the ground truth mel spectrograms, "
15
+ "the wavs and the embeds.")
16
+ parser.add_argument("-m", "--models_dir", type=str, default="synthesizer/saved_models/", help=\
17
+ "Path to the output directory that will contain the saved model weights and the logs.")
18
+ parser.add_argument("-s", "--save_every", type=int, default=1000, help= \
19
+ "Number of steps between updates of the model on the disk. Set to 0 to never save the "
20
+ "model.")
21
+ parser.add_argument("-b", "--backup_every", type=int, default=25000, help= \
22
+ "Number of steps between backups of the model. Set to 0 to never make backups of the "
23
+ "model.")
24
+ parser.add_argument("-f", "--force_restart", action="store_true", help= \
25
+ "Do not load any saved model and restart from scratch.")
26
+ parser.add_argument("--hparams", default="",
27
+ help="Hyperparameter overrides as a comma-separated list of name=value "
28
+ "pairs")
29
+ args = parser.parse_args()
30
+ print_args(args, parser)
31
+
32
+ args.hparams = hparams.parse(args.hparams)
33
+
34
+ # Run the training
35
+ train(**vars(args))