ChatTTS-Forge icon indicating copy to clipboard operation
ChatTTS-Forge copied to clipboard

[Feature] Support customized models path

Open kerol123 opened this issue 6 months ago • 2 comments

确认清单

  • [X] 我已经仔细阅读项目文档,确认现有功能无法解决我的需求
  • [X] 我已经检索过现有issue,确认与现有issue的内容并不重复
  • [X] 确认并非问题讨论而是 Feature request

功能描述

I used common models for different projects, but I don't want to copy these models to each projects cuz some model weight files consume large disk space. We can config model path in environments.

可能的解决方案

When we load model from path, we can firstly read from relative environment variables, if not found, we use default ./models/ path. For ChatTTS example in modules/core/models/zoo/ChatTTS.py

# before in line 32
custom_path="./models/ChatTTS",
# after
custom_path=os.getenv("CHATTTS_MODEL_PATH", "./models/ChatTTS"),

we can define environment variables in .env.global just like .env.api or .env.webui

kerol123 avatar Aug 23 '24 14:08 kerol123