diff --git a/ChatTTS/core.py b/ChatTTS/core.py index 2031100..fd220b1 100644 --- a/ChatTTS/core.py +++ b/ChatTTS/core.py @@ -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) diff --git a/ChatTTS/model/gpt.py b/ChatTTS/model/gpt.py index 754dc1b..651fc68 100644 --- a/ChatTTS/model/gpt.py +++ b/ChatTTS/model/gpt.py @@ -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__() diff --git a/examples/web/funcs.py b/examples/web/funcs.py index a1adc90..e84d0e8 100644 --- a/examples/web/funcs.py +++ b/examples/web/funcs.py @@ -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: diff --git a/examples/web/webui.py b/examples/web/webui.py index 89c0b82..4ac3ca7 100644 --- a/examples/web/webui.py +++ b/examples/web/webui.py @@ -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.")