Change default speakers file extension

This commit is contained in:
WeberJulian 2022-06-01 10:31:26 +02:00
parent 39f31e3d39
commit d7de111b76
1 changed files with 3 additions and 3 deletions

View File

@ -407,16 +407,16 @@ class BaseTTS(BaseTrainerModel):
return test_figures, test_audios
def on_init_start(self, trainer):
"""Save the speaker.json and language_ids.json at the beginning of the training. Also update both paths."""
"""Save the speaker.pth and language_ids.json at the beginning of the training. Also update both paths."""
if self.speaker_manager is not None:
output_path = os.path.join(trainer.output_path, "speakers.json")
output_path = os.path.join(trainer.output_path, "speakers.pth")
self.speaker_manager.save_ids_to_file(output_path)
trainer.config.speakers_file = output_path
# some models don't have `model_args` set
if hasattr(trainer.config, "model_args"):
trainer.config.model_args.speakers_file = output_path
trainer.config.save_json(os.path.join(trainer.output_path, "config.json"))
print(f" > `speakers.json` is saved to {output_path}.")
print(f" > `speakers.pth` is saved to {output_path}.")
print(" > `speakers_file` is updated in the config.json.")
if hasattr(self, "language_manager") and self.language_manager is not None: