From 49feaf5fa117d317501fbb47073f2e4060a94d86 Mon Sep 17 00:00:00 2001 From: manmay-nakhashi Date: Tue, 2 May 2023 00:51:29 +0530 Subject: [PATCH] fix tests --- TTS/bin/synthesize.py | 5 +++++ TTS/tts/models/tortoise.py | 17 ++++++----------- TTS/utils/manage.py | 1 - 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/TTS/bin/synthesize.py b/TTS/bin/synthesize.py index 092264f4..d7b0a7b8 100755 --- a/TTS/bin/synthesize.py +++ b/TTS/bin/synthesize.py @@ -306,6 +306,7 @@ If you don't specify any models, then it uses LJSpeech based English model. encoder_config_path = None vc_path = None vc_config_path = None + model_dir = None # CASE1 #list : list pre-trained TTS models if args.list_models: @@ -336,6 +337,9 @@ If you don't specify any models, then it uses LJSpeech based English model. if args.model_name is not None and not args.model_path: model_path, config_path, model_item = manager.download_model(args.model_name) + # tortoise model + if model_path.split("--")[-1] == "tortoise-v2": + model_dir = model_path # tts model if model_item["model_type"] == "tts_models": tts_path = model_path @@ -379,6 +383,7 @@ If you don't specify any models, then it uses LJSpeech based English model. encoder_config_path, vc_path, vc_config_path, + model_dir, args.use_cuda, ) diff --git a/TTS/tts/models/tortoise.py b/TTS/tts/models/tortoise.py index 841013dc..d0b4418b 100644 --- a/TTS/tts/models/tortoise.py +++ b/TTS/tts/models/tortoise.py @@ -1,7 +1,7 @@ import os import random from contextlib import contextmanager -from dataclasses import dataclass, field +from dataclasses import dataclass from time import time import torch @@ -392,11 +392,6 @@ class Tortoise(BaseTTS): yield m m = model.cpu() - def speaker_manager( - self, - ): - self.speaker_names = os.listdir() - def get_conditioning_latents( self, voice_samples, @@ -804,17 +799,17 @@ class Tortoise(BaseTTS): } return return_dict - def forward(): + def forward(self): raise NotImplementedError("Tortoise Training is not implemented") - def eval_step(): + def eval_step(self): raise NotImplementedError("Tortoise Training is not implemented") - def init_from_config(): + def init_from_config(self): raise NotImplementedError("Tortoise Training is not implemented") - def load_checkpoint(): + def load_checkpoint(self): raise NotImplementedError("Tortoise Training is not implemented") - def train_step(): + def train_step(self): raise NotImplementedError("Tortoise Training is not implemented") diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 7c935732..2913c391 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -299,7 +299,6 @@ class ModelManager(object): model_file = None config_file = None for file_name in os.listdir(output_path): - print(file_name) if file_name in ["model_file.pth", "model_file.pth.tar", "model.pth"]: model_file = os.path.join(output_path, file_name) elif file_name == "config.json":