mirror of
https://github.com/2noise/ChatTTS.git
synced 2026-08-29 02:10:59 +08:00
chore: make lint happy
This commit is contained in:
+2
-2
@@ -145,7 +145,7 @@ class Chat:
|
||||
use_flash_attn=False,
|
||||
use_vllm=False,
|
||||
experimental: bool = False,
|
||||
enable_cache=False,
|
||||
enable_cache=True,
|
||||
) -> bool:
|
||||
download_path = self.download_models(source, force_redownload, custom_path)
|
||||
if download_path is None:
|
||||
@@ -289,7 +289,7 @@ class Chat:
|
||||
use_flash_attn=False,
|
||||
use_vllm=False,
|
||||
experimental: bool = False,
|
||||
enable_cache = False,
|
||||
enable_cache = True,
|
||||
):
|
||||
if device is None:
|
||||
device = select_device(experimental=experimental)
|
||||
|
||||
@@ -28,7 +28,7 @@ class GPT(nn.Module):
|
||||
device=torch.device("cpu"),
|
||||
device_gpt=torch.device("cpu"),
|
||||
logger=logging.getLogger(__name__),
|
||||
enable_cache=False,
|
||||
enable_cache=True,
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ def on_audio_seed_change(audio_seed_input):
|
||||
return rand_spk
|
||||
|
||||
|
||||
def load_chat(cust_path: Optional[str], coef: Optional[str], enable_cache = False) -> bool:
|
||||
def load_chat(cust_path: Optional[str], coef: Optional[str], enable_cache = True) -> bool:
|
||||
if cust_path == None:
|
||||
ret = chat.load(coef=coef, enable_cache=enable_cache)
|
||||
else:
|
||||
|
||||
@@ -261,12 +261,12 @@ def main():
|
||||
parser.add_argument("--root_path", type=str, help="root path")
|
||||
parser.add_argument("--custom_path", type=str, help="custom model path")
|
||||
parser.add_argument("--coef", type=str, help="custom dvae coefficient")
|
||||
parser.add_argument("--enable_cache", action="store_true", help="enable model cache")
|
||||
parser.add_argument("--disable_cache", action="store_true", help="enable model cache")
|
||||
args = parser.parse_args()
|
||||
|
||||
logger.info("loading ChatTTS model...")
|
||||
|
||||
if load_chat(args.custom_path, args.coef, args.enable_cache):
|
||||
if load_chat(args.custom_path, args.coef, not args.disable_cache):
|
||||
logger.info("Models loaded successfully.")
|
||||
else:
|
||||
logger.error("Models load failed.")
|
||||
|
||||
Reference in New Issue
Block a user