mirror of
https://github.com/litagin02/rvc-tts-webui.git
synced 2026-01-19 18:41:51 +00:00
Change to use os.path.join
This commit is contained in:
@@ -48,6 +48,8 @@ weights
|
||||
|
||||
Each model directory should contain exactly one `.pth` file and at most one `.index` file. Directory names are used as model names.
|
||||
|
||||
It seems that non-ASCII characters in path names gave faiss errors (like `weights/モデル1/index.index`), so please avoid them.
|
||||
|
||||
## Launch
|
||||
|
||||
```bash
|
||||
|
||||
14
app.py
14
app.py
@@ -36,10 +36,12 @@ tts_voice_list = asyncio.get_event_loop().run_until_complete(edge_tts.list_voice
|
||||
tts_voices = [f"{v['ShortName']}-{v['Gender']}" for v in tts_voice_list]
|
||||
|
||||
model_root = "weights"
|
||||
models = [d for d in os.listdir(model_root) if os.path.isdir(f"{model_root}/{d}")]
|
||||
models.sort()
|
||||
models = [
|
||||
d for d in os.listdir(model_root) if os.path.isdir(os.path.join(model_root, d))
|
||||
]
|
||||
if len(models) == 0:
|
||||
raise ValueError("No model found in `weights` folder")
|
||||
models.sort()
|
||||
hubert_model = None
|
||||
|
||||
print("Loading rmvpe model...")
|
||||
@@ -50,8 +52,8 @@ print("rmvpe model loaded.")
|
||||
def model_data(model_name):
|
||||
# global n_spk, tgt_sr, net_g, vc, cpt, version, index_file
|
||||
pth_files = [
|
||||
f"{model_root}/{model_name}/{f}"
|
||||
for f in os.listdir(f"{model_root}/{model_name}")
|
||||
os.path.join(model_root, model_name, f)
|
||||
for f in os.listdir(os.path.join(model_root, model_name))
|
||||
if f.endswith(".pth")
|
||||
]
|
||||
if len(pth_files) == 0:
|
||||
@@ -87,8 +89,8 @@ def model_data(model_name):
|
||||
# n_spk = cpt["config"][-3]
|
||||
|
||||
index_files = [
|
||||
f"{model_root}/{model_name}/{f}"
|
||||
for f in os.listdir(f"{model_root}/{model_name}")
|
||||
os.path.join(model_root, model_name, f)
|
||||
for f in os.listdir(os.path.join(model_root, model_name))
|
||||
if f.endswith(".index")
|
||||
]
|
||||
if len(index_files) == 0:
|
||||
|
||||
Reference in New Issue
Block a user