mirror of https://github.com/coqui-ai/TTS.git
Change default speakers file extension
This commit is contained in:
parent
39f31e3d39
commit
d7de111b76
|
@ -407,16 +407,16 @@ class BaseTTS(BaseTrainerModel):
|
||||||
return test_figures, test_audios
|
return test_figures, test_audios
|
||||||
|
|
||||||
def on_init_start(self, trainer):
|
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:
|
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)
|
self.speaker_manager.save_ids_to_file(output_path)
|
||||||
trainer.config.speakers_file = output_path
|
trainer.config.speakers_file = output_path
|
||||||
# some models don't have `model_args` set
|
# some models don't have `model_args` set
|
||||||
if hasattr(trainer.config, "model_args"):
|
if hasattr(trainer.config, "model_args"):
|
||||||
trainer.config.model_args.speakers_file = output_path
|
trainer.config.model_args.speakers_file = output_path
|
||||||
trainer.config.save_json(os.path.join(trainer.output_path, "config.json"))
|
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.")
|
print(" > `speakers_file` is updated in the config.json.")
|
||||||
|
|
||||||
if hasattr(self, "language_manager") and self.language_manager is not None:
|
if hasattr(self, "language_manager") and self.language_manager is not None:
|
||||||
|
|
Loading…
Reference in New Issue