mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 08:43:57 +03:00
WIP:common sample
This commit is contained in:
parent
99cf22041f
commit
87de3dc10f
@ -5,7 +5,7 @@ from typing import cast
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
import torchaudio
|
import torchaudio
|
||||||
from ModelSample import getModelSamples
|
from utils.downloader.SampleDownloader import getSampleInfos
|
||||||
from voice_changer.RVC.ModelSlot import ModelSlot
|
from voice_changer.RVC.ModelSlot import ModelSlot
|
||||||
from voice_changer.RVC.SampleDownloader import downloadModelFiles
|
from voice_changer.RVC.SampleDownloader import downloadModelFiles
|
||||||
|
|
||||||
@ -44,7 +44,6 @@ from Exceptions import DeviceCannotSupportHalfPrecisionException, NoModeLoadedEx
|
|||||||
from const import (
|
from const import (
|
||||||
RVC_MODEL_DIRNAME,
|
RVC_MODEL_DIRNAME,
|
||||||
UPLOAD_DIR,
|
UPLOAD_DIR,
|
||||||
getRVCSampleJsonAndModelIds,
|
|
||||||
)
|
)
|
||||||
import shutil
|
import shutil
|
||||||
import json
|
import json
|
||||||
@ -72,15 +71,15 @@ class RVC:
|
|||||||
print("[Voice Changer] RVC initialization: ", params)
|
print("[Voice Changer] RVC initialization: ", params)
|
||||||
|
|
||||||
# サンプルカタログ作成
|
# サンプルカタログ作成
|
||||||
sampleJsons: list[str] = []
|
# sampleJsons: list[str] = []
|
||||||
sampleJsonUrls, _sampleModels = getRVCSampleJsonAndModelIds(params.rvc_sample_mode)
|
samples = getSampleInfos(params.sample_mode)
|
||||||
for url in sampleJsonUrls:
|
# for url in sampleJsonUrls:
|
||||||
filename = os.path.basename(url)
|
# filename = os.path.basename(url)
|
||||||
sampleJsons.append(filename)
|
# sampleJsons.append(filename)
|
||||||
sampleModels = getModelSamples(sampleJsons, "RVC")
|
# sampleModels = getModelSamples(sampleJsons, "RVC")
|
||||||
if sampleModels is not None:
|
# if sampleModels is not None:
|
||||||
self.settings.sampleModels = sampleModels
|
# self.settings.sampleModels = sampleModels
|
||||||
|
self.settings.sampleModels = samples
|
||||||
# 起動時にスロットにモデルがある場合はロードしておく
|
# 起動時にスロットにモデルがある場合はロードしておく
|
||||||
if len(self.settings.modelSlots) > 0:
|
if len(self.settings.modelSlots) > 0:
|
||||||
for i, slot in enumerate(self.settings.modelSlots):
|
for i, slot in enumerate(self.settings.modelSlots):
|
||||||
|
Loading…
Reference in New Issue
Block a user