diff --git a/ChatTTS/core.py b/ChatTTS/core.py index 33da06fb6..1802eb0fb 100644 --- a/ChatTTS/core.py +++ b/ChatTTS/core.py @@ -87,7 +87,7 @@ def download_models( return download_path - def load_models( + def load( self, source: Literal['huggingface', 'local', 'custom']='local', force_redownload=False, diff --git a/README.md b/README.md index 1312c0319..6d160d258 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ from IPython.display import Audio import torchaudio chat = ChatTTS.Chat() -chat.load_models(compile=False) # Set to True for better performance +chat.load(compile=False) # Set to True for better performance texts = ["PUT YOUR TEXT HERE",] diff --git a/docs/cn/README.md b/docs/cn/README.md index 8401622f7..7c1598ee2 100644 --- a/docs/cn/README.md +++ b/docs/cn/README.md @@ -125,7 +125,7 @@ from IPython.display import Audio import torchaudio chat = ChatTTS.Chat() -chat.load_models(compile=False) # Set to True for better performance +chat.load(compile=False) # Set to True for better performance texts = ["PUT YOUR TEXT HERE",] diff --git a/docs/jp/README.md b/docs/jp/README.md index 462b3ee33..2f7adda16 100644 --- a/docs/jp/README.md +++ b/docs/jp/README.md @@ -36,7 +36,7 @@ import ChatTTS from IPython.display import Audio chat = ChatTTS.Chat() -chat.load_models(compile=False) # より良いパフォーマンスのためにTrueに設定 +chat.load(compile=False) # より良いパフォーマンスのためにTrueに設定 texts = ["ここにテキストを入力してください",] diff --git a/docs/ru/README.md b/docs/ru/README.md index c4a646c7f..f93a8caef 100644 --- a/docs/ru/README.md +++ b/docs/ru/README.md @@ -36,7 +36,7 @@ import ChatTTS from IPython.display import Audio chat = ChatTTS.Chat() -chat.load_models(compile=False) # Установите значение True для лучшей производительности +chat.load(compile=False) # Установите значение True для лучшей производительности texts = ["ВВЕДИТЕ ВАШ ТЕКСТ ЗДЕСЬ",] diff --git a/examples/cmd/run.py b/examples/cmd/run.py index 2294bb614..14ad0e3ea 100644 --- a/examples/cmd/run.py +++ b/examples/cmd/run.py @@ -33,7 +33,7 @@ def main(texts: list[str]): chat = ChatTTS.Chat(get_logger("ChatTTS")) logger.info("Initializing ChatTTS...") - if chat.load_models(): + if chat.load(): logger.info("Models loaded successfully.") else: logger.error("Models load failed.") diff --git a/examples/ipynb/colab.ipynb b/examples/ipynb/colab.ipynb index 416f42e73..5a39668a1 100644 --- a/examples/ipynb/colab.ipynb +++ b/examples/ipynb/colab.ipynb @@ -123,7 +123,7 @@ "outputs": [], "source": [ "# use force_redownload=True if the weights have been updated.\n", - "chat.load_models(source='huggingface', force_redownload=True)" + "chat.load(source='huggingface', force_redownload=True)" ] }, { @@ -143,8 +143,8 @@ }, "outputs": [], "source": [ - "chat.load_models()\n", - "# chat.load_models(source='local') same as above" + "chat.load()\n", + "# chat.load(source='local') same as above" ] }, { @@ -165,7 +165,7 @@ "outputs": [], "source": [ "# write the model path into custom_path\n", - "chat.load_models(source='custom', custom_path='YOUR CUSTOM PATH')" + "chat.load(source='custom', custom_path='YOUR CUSTOM PATH')" ] }, { diff --git a/examples/ipynb/example.ipynb b/examples/ipynb/example.ipynb index e4075d070..dea7d27b6 100644 --- a/examples/ipynb/example.ipynb +++ b/examples/ipynb/example.ipynb @@ -98,7 +98,7 @@ "outputs": [], "source": [ "# use force_redownload=True if the weights have been updated.\n", - "chat.load_models(source='huggingface', force_redownload=True)" + "chat.load(source='huggingface', force_redownload=True)" ] }, { @@ -114,8 +114,8 @@ "metadata": {}, "outputs": [], "source": [ - "chat.load_models()\n", - "# chat.load_models(source='local') same as above" + "chat.load()\n", + "# chat.load(source='local') same as above" ] }, { @@ -132,7 +132,7 @@ "outputs": [], "source": [ "# write the model path into custom_path\n", - "chat.load_models(source='custom', custom_path='YOUR CUSTOM PATH')" + "chat.load(source='custom', custom_path='YOUR CUSTOM PATH')" ] }, { diff --git a/examples/web/funcs.py b/examples/web/funcs.py index 922835aa5..41c1d2b0c 100644 --- a/examples/web/funcs.py +++ b/examples/web/funcs.py @@ -40,10 +40,10 @@ def on_voice_change(vocie_selection): def load_chat(cust_path: Optional[str], coef: Optional[str]) -> bool: if cust_path == None: - ret = chat.load_models(coef=coef, compile=sys.platform != 'win32') + ret = chat.load(coef=coef, compile=sys.platform != 'win32') else: logger.info('local model path: %s', cust_path) - ret = chat.load_models('custom', custom_path=cust_path, coef=coef, compile=sys.platform != 'win32') + ret = chat.load('custom', custom_path=cust_path, coef=coef, compile=sys.platform != 'win32') global custom_path custom_path = cust_path if ret: