mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 21:45:00 +03:00
remove tqdm
This commit is contained in:
parent
44593719f5
commit
71683c859b
@ -131,6 +131,28 @@ def download(params):
|
||||
print(e)
|
||||
|
||||
|
||||
def download_no_tqdm(params):
|
||||
url = params["url"]
|
||||
saveTo = params["saveTo"]
|
||||
dirname = os.path.dirname(saveTo)
|
||||
if dirname != "":
|
||||
os.makedirs(dirname, exist_ok=True)
|
||||
try:
|
||||
req = requests.get(url, stream=True, allow_redirects=True)
|
||||
with open(saveTo, "wb") as f:
|
||||
countToDot = 0
|
||||
for chunk in req.iter_content(chunk_size=1024):
|
||||
if chunk:
|
||||
f.write(chunk)
|
||||
countToDot += 1
|
||||
if countToDot % 1024 == 0:
|
||||
print(".", end="")
|
||||
|
||||
print("+", end="")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
def downloadWeight():
|
||||
# content_vec_500 = (args.content_vec_500,)
|
||||
# content_vec_500_onnx = (args.content_vec_500_onnx,)
|
||||
@ -232,7 +254,7 @@ if __name__ == "MMVCServerSIO":
|
||||
)
|
||||
|
||||
try:
|
||||
download({"url": SAMPLES_JSON, "saveTo": args.samples, "position": 0})
|
||||
download_no_tqdm({"url": SAMPLES_JSON, "saveTo": args.samples, "position": 0})
|
||||
except Exception as e:
|
||||
print("[Voice Changer] loading sample failed", e)
|
||||
|
||||
|
@ -6,7 +6,7 @@ from dataclasses import asdict
|
||||
from typing import cast
|
||||
import numpy as np
|
||||
import torch
|
||||
from MMVCServerSIO import download
|
||||
from MMVCServerSIO import download_no_tqdm
|
||||
from ModelSample import RVCModelSample, getModelSamples
|
||||
|
||||
|
||||
@ -130,8 +130,11 @@ class RVC:
|
||||
"position": 2,
|
||||
}
|
||||
)
|
||||
|
||||
print("[Voice Changer] Downloading model files...", end="")
|
||||
with ThreadPoolExecutor() as pool:
|
||||
pool.map(download, downloadParams)
|
||||
pool.map(download_no_tqdm, downloadParams)
|
||||
print("")
|
||||
return modelPath, indexPath, featurePath
|
||||
|
||||
def loadModel(self, props: LoadModelParams):
|
||||
|
Loading…
Reference in New Issue
Block a user