mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-07 04:09:06 +08:00
feat(gui): add assets checking
This commit is contained in:
parent
5266fd1b71
commit
aa3908062f
14
gui_v1.py
14
gui_v1.py
@ -142,9 +142,23 @@ if __name__ == "__main__":
|
|||||||
self.input_devices_indices = None
|
self.input_devices_indices = None
|
||||||
self.output_devices_indices = None
|
self.output_devices_indices = None
|
||||||
self.stream = None
|
self.stream = None
|
||||||
|
if not self.config.nocheck: self.check_assets()
|
||||||
self.update_devices()
|
self.update_devices()
|
||||||
self.launcher()
|
self.launcher()
|
||||||
|
|
||||||
|
def check_assets(self):
|
||||||
|
global now_dir
|
||||||
|
from infer.lib.rvcmd import check_all_assets, download_all_assets
|
||||||
|
|
||||||
|
tmp = os.path.join(now_dir, "TEMP")
|
||||||
|
shutil.rmtree(tmp, ignore_errors=True)
|
||||||
|
os.makedirs(tmp, exist_ok=True)
|
||||||
|
if not check_all_assets():
|
||||||
|
download_all_assets(tmpdir=tmp)
|
||||||
|
if not check_all_assets():
|
||||||
|
printt("counld not satisfy all assets needed.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
try:
|
try:
|
||||||
if not os.path.exists("configs/inuse/config.json"):
|
if not os.path.exists("configs/inuse/config.json"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user