jbetker commited on
Commit
39ab8a9
1 Parent(s): fc8d52a
Files changed (1) hide show
  1. do_tts.py +2 -5
do_tts.py CHANGED
@@ -11,14 +11,11 @@ if __name__ == '__main__':
11
  parser.add_argument('--text', type=str, help='Text to speak.', default="I am a language model that has learned to speak.")
12
  parser.add_argument('--voice', type=str, help='Selects the voice to use for generation. See options in voices/ directory (and add your own!) '
13
  'Use the & character to join two voices together. Use a comma to perform inference on multiple voices.', default='patrick_stewart')
14
- parser.add_argument('--num_samples', type=int, help='How many total outputs the autoregressive transformer should produce.', default=256)
15
- parser.add_argument('--batch_size', type=int, help='How many samples to process at once in the autoregressive model.', default=16)
16
- parser.add_argument('--num_diffusion_samples', type=int, help='Number of outputs that progress to the diffusion stage.', default=16)
17
  parser.add_argument('--output_path', type=str, help='Where to store outputs.', default='results/')
18
  args = parser.parse_args()
19
  os.makedirs(args.output_path, exist_ok=True)
20
 
21
- tts = TextToSpeech(autoregressive_batch_size=args.batch_size)
22
 
23
  voices = get_voices()
24
  selected_voices = args.voice.split(',')
@@ -28,6 +25,6 @@ if __name__ == '__main__':
28
  for cond_path in cond_paths:
29
  c = load_audio(cond_path, 22050)
30
  conds.append(c)
31
- gen = tts.tts(args.text, conds, num_autoregressive_samples=args.num_samples)
32
  torchaudio.save(os.path.join(args.output_path, f'{voice}.wav'), gen.squeeze(0).cpu(), 24000)
33
 
 
11
  parser.add_argument('--text', type=str, help='Text to speak.', default="I am a language model that has learned to speak.")
12
  parser.add_argument('--voice', type=str, help='Selects the voice to use for generation. See options in voices/ directory (and add your own!) '
13
  'Use the & character to join two voices together. Use a comma to perform inference on multiple voices.', default='patrick_stewart')
 
 
 
14
  parser.add_argument('--output_path', type=str, help='Where to store outputs.', default='results/')
15
  args = parser.parse_args()
16
  os.makedirs(args.output_path, exist_ok=True)
17
 
18
+ tts = TextToSpeech()
19
 
20
  voices = get_voices()
21
  selected_voices = args.voice.split(',')
 
25
  for cond_path in cond_paths:
26
  c = load_audio(cond_path, 22050)
27
  conds.append(c)
28
+ gen = tts.tts_with_preset(args.text, conds, preset='standard')
29
  torchaudio.save(os.path.join(args.output_path, f'{voice}.wav'), gen.squeeze(0).cpu(), 24000)
30