2noise / ChatTTS

A generative speech model for daily dialogue.
https://2noise.com
GNU Affero General Public License v3.0
32.23k stars 3.5k forks source link

Launch WebUI出现错误 #686

Closed JadeRabbit99 closed 1 month ago

JadeRabbit99 commented 3 months ago
D:\Soft\CommonSoft\Python\Lib\site-packages\vector_quantize_pytorch\vector_quantize_pytorch.py:462: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  @autocast(enabled = False)
D:\Soft\CommonSoft\Python\Lib\site-packages\vector_quantize_pytorch\vector_quantize_pytorch.py:647: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  @autocast(enabled = False)
D:\Soft\CommonSoft\Python\Lib\site-packages\vector_quantize_pytorch\finite_scalar_quantization.py:162: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  @autocast(enabled = False)
[+0800 20240812 23:26:03] [WARN]  WebUI  | funcs | no ffmpeg installed, use wav file output
[+0800 20240812 23:26:03] [INFO]  WebUI  | webui | loading ChatTTS model...
[+0800 20240812 23:26:03] [INFO] ChatTTS | dl | checking assets...
[+0800 20240812 23:26:03] [INFO] ChatTTS | dl | D:\Soft\CommonSoft\Github\ChatTTS\ChatTTS\asset\Decoder.pt not exist.
[+0800 20240812 23:26:03] [INFO] ChatTTS | dl | downloading https://github.com/fumiama/RVC-Models-Downloader/releases/download/v0.2.5/rvcmd_windows_amd64.zip
[+0800 20240812 23:26:05] [INFO] ChatTTS | dl | downloaded.
[+0800 20240812 23:26:05] [INFO] ChatTTS | dl | extracted into C:\Users\ADMINI~1\AppData\Local\Temp\tmpywxkvduo
panic: The handle is invalid.

goroutine 1 [running]:
rvcmd/console.init.0()
        rvcmd/console/console_windows.go:46 +0x1d4
[+0800 20240812 23:26:05] [INFO] ChatTTS | dl | checking assets...
[+0800 20240812 23:26:05] [INFO] ChatTTS | dl | D:\Soft\CommonSoft\Github\ChatTTS\ChatTTS\asset\Decoder.pt not exist.
[+0800 20240812 23:26:05] [ERRO] ChatTTS | core | download to local path D:\Soft\CommonSoft\Github\ChatTTS\ChatTTS failed.
[+0800 20240812 23:26:05] [ERRO]  WebUI  | webui | Models load failed.

asset文件如何获取?

JadeRabbit99 commented 2 months ago

在这里下载 https://huggingface.co/2Noise/ChatTTS/tree/main/asset

fumiama commented 2 months ago

与 #620 重复。

goshut commented 2 months ago

@https://github.com/2noise/ChatTTS/issues/620 这是个bug,, https://github.com/fumiama/RVC-Models-Downloader/commit/ff8949393c577f56c7456c08b2398580c536f535 这个项目是调用rvcmd.exe来下载的,但它下载的文件和check_all_assets函数检查的文件不一样导致失败.(这个耦合度未免也太微妙了....)

def check_all_assets(base_dir: Path, sha256_map: Dict[str, str], update=False) -> bool:
    logger.get_logger().info("checking assets...")
    current_dir = base_dir / "asset"
    names = [
        "Decoder.pt",
        "DVAE_full.pt",
        "GPT.pt",
        "spk_stat.pt",
        "tokenizer.pt",
        "Vocos.pt",
    ]
    for model in names:
        menv = model.replace(".", "_")
        if not check_model(
            current_dir, model, sha256_map[f"sha256_asset_{menv}"], update
        ):
            return False

    logger.get_logger().info("all assets are already latest.")
    return True
fumiama commented 2 months ago

但它下载的文件和check_all_assets函数检查的文件不一样导致失败

不应该啊,main分支用的是rvcmd0.2.6版本,dev用的是0.2.7版本,每个版本下什么文件都是定好的,不会出现错误,除非手动下载了rvcmd

goshut commented 2 months ago

@fumiama 那是我的问题,我手动指定了下载器,是最新版的...

goshut commented 2 months ago

提个建议啊, 既然允许用户pip install的方式安装. 就应该考虑本项目的地址和用户的工程项目地址不在同一目录的情况吧. 但[ChatTTS]目前来看只有当前路径的概念,但没有项目库路径的概念. 导致每建一个新项目,就会新下载一遍asset这个文件夹里的内容.

为了避免重复下载,我目前都是这样的

chat = ChatTTS.Chat()
chat.load(compile=False,
          source="custom",
          custom_path="asset文件夹的文件夹..")# 感觉有点怪
fumiama commented 2 months ago

考虑让用户自定义下载路径

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 15 days since being marked as stale.