Skip to content

Commit

Permalink
Make style
Browse files Browse the repository at this point in the history
  • Loading branch information
erogol committed Nov 27, 2023
1 parent 2fd8cf3 commit 3b8894a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 7 additions & 2 deletions TTS/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from TTS.utils.synthesizer import Synthesizer
from TTS.config import load_config


class TTS(nn.Module):
"""TODO: Add voice conversion and Capacitron support."""

Expand Down Expand Up @@ -107,8 +108,12 @@ def is_coqui_studio(self):
@property
def is_multi_lingual(self):
# Not sure what sets this to None, but applied a fix to prevent crashing.
if (isinstance(self.model_name, str) and "xtts" in self.model_name or
self.config and ("xtts" in self.config.model or len(self.config.languages) > 1)):
if (
isinstance(self.model_name, str)
and "xtts" in self.model_name
or self.config
and ("xtts" in self.config.model or len(self.config.languages) > 1)
):
return True
if hasattr(self.synthesizer.tts_model, "language_manager") and self.synthesizer.tts_model.language_manager:
return self.synthesizer.tts_model.language_manager.num_languages > 1
Expand Down
2 changes: 1 addition & 1 deletion TTS/tts/layers/xtts/trainer/gpt_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def eval_step(self, batch, criterion):
return self.train_step(batch, criterion)

def on_train_epoch_start(self, trainer):
trainer.model.eval() # the whole model to eval
trainer.model.eval() # the whole model to eval
# put gpt model in training mode
trainer.model.xtts.gpt.train()

Expand Down
3 changes: 1 addition & 2 deletions TTS/utils/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
}



class ModelManager(object):
tqdm_progress = None
"""Manage TTS models defined in .models.json.
Expand Down Expand Up @@ -315,7 +314,7 @@ def _set_model_item(self, model_name):
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/model.pth",
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/config.json",
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/vocab.json",
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/hash.md5"
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/hash.md5",
],
}
print(model_item)
Expand Down

0 comments on commit 3b8894a

Please sign in to comment.