Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何自定义模型路径? #821

Open
tao-xiaoxin opened this issue Nov 21, 2024 · 1 comment
Open

如何自定义模型路径? #821

tao-xiaoxin opened this issue Nov 21, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation stale The topic has been ignored for a long time

Comments

@tao-xiaoxin
Copy link

tao-xiaoxin commented Nov 21, 2024

我将模型下载到本地了,机器无网络,我想知道参数如何指定我下载的路径,ChatTTS 是通过pip 安装的,使用如下代码会下载模型:

import ChatTTS
import torch
import torchaudio
model_path ="/tmp/ai_data/ai_models/audio_models/AI-ModelScope/ChatTTS"
chat = ChatTTS.Chat()
torch_device = torch.device("cuda:1")
is_model_loaded = chat.load(compile=False, custom_path=model_path, device=torch_device)
texts = ["PUT YOUR 1st TEXT HERE", "PUT YOUR 2nd TEXT HERE"]

wavs = chat.infer(texts)

for i in range(len(wavs)):
    """
    In some versions of torchaudio, the first line works but in other versions, so does the second line.
    """
    try:
        torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000)
    except:
        torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]), 24000)

提示如下错误:

The above exception was the direct cause of the following exception:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gitea.seku.su', port=443): Max retries exceeded with url: /fumiama/RVC-Models-Downloader/raw/branch/main/dns.yaml (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe5d4b4c250>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:
@fumiama fumiama added the documentation Improvements or additions to documentation label Nov 22, 2024
@fumiama
Copy link
Member

fumiama commented Nov 22, 2024

还要加一个参数source="custom"

@github-actions github-actions bot added the stale The topic has been ignored for a long time label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation stale The topic has been ignored for a long time
Projects
None yet
Development

No branches or pull requests

2 participants