mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-09 12:30:38 +08:00
chore(format): run black on dev (#2099)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ab07a8b1bc
commit
c38088dc6e
@@ -43,7 +43,8 @@ def save_small_model(ckpt, sr, if_f0, name, epoch, version, hps):
|
||||
opt["info"] = "%sepoch" % epoch
|
||||
opt["name"] = name
|
||||
opt["timestamp"] = int(time())
|
||||
if hps.author: opt["author"] = hps.author
|
||||
if hps.author:
|
||||
opt["author"] = hps.author
|
||||
opt["sr"] = sr
|
||||
opt["f0"] = if_f0
|
||||
opt["version"] = version
|
||||
@@ -179,7 +180,8 @@ def extract_small_model(path, name, author, sr, if_f0, info, version):
|
||||
opt["info"] = info
|
||||
opt["name"] = name
|
||||
opt["timestamp"] = int(time())
|
||||
if author: opt["author"] = author
|
||||
if author:
|
||||
opt["author"] = author
|
||||
opt["version"] = version
|
||||
opt["sr"] = sr
|
||||
opt["f0"] = int(if_f0)
|
||||
@@ -216,12 +218,15 @@ def merge(path1, path2, alpha1, sr, f0, info, name, version):
|
||||
continue
|
||||
opt["weight"][key] = a[key]
|
||||
return opt
|
||||
|
||||
|
||||
def authors(c1, c2):
|
||||
a1, a2 = c1.get("author", ""), c2.get("author", "")
|
||||
if a1 == a2: return a1
|
||||
if not a1: a1 = "Unknown"
|
||||
if not a2: a2 = "Unknown"
|
||||
if a1 == a2:
|
||||
return a1
|
||||
if not a1:
|
||||
a1 = "Unknown"
|
||||
if not a2:
|
||||
a2 = "Unknown"
|
||||
return f"{a1} & {a2}"
|
||||
|
||||
ckpt1 = torch.load(path1, map_location="cpu")
|
||||
@@ -260,7 +265,8 @@ def merge(path1, path2, alpha1, sr, f0, info, name, version):
|
||||
"""
|
||||
opt["name"] = name
|
||||
opt["timestamp"] = int(time())
|
||||
if author: opt["author"] = author
|
||||
if author:
|
||||
opt["author"] = author
|
||||
opt["sr"] = sr
|
||||
opt["f0"] = 1 if f0 == i18n("是") else 0
|
||||
opt["version"] = version
|
||||
|
||||
@@ -358,9 +358,7 @@ def get_hparams(init=True):
|
||||
required=True,
|
||||
help="if caching the dataset in GPU memory, 1 or 0",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-a", "--author", type=str, default="", help="Model author"
|
||||
)
|
||||
parser.add_argument("-a", "--author", type=str, default="", help="Model author")
|
||||
|
||||
args = parser.parse_args()
|
||||
name = args.experiment_dir
|
||||
@@ -389,6 +387,7 @@ def get_hparams(init=True):
|
||||
hparams.author = args.author
|
||||
return hparams
|
||||
|
||||
|
||||
"""
|
||||
def get_hparams_from_dir(model_dir):
|
||||
config_save_path = os.path.join(model_dir, "config.json")
|
||||
@@ -435,6 +434,7 @@ def check_git_hash(model_dir):
|
||||
open(path, "w").write(cur_hash)
|
||||
"""
|
||||
|
||||
|
||||
def get_logger(model_dir, filename="train.log"):
|
||||
global logger
|
||||
logger = logging.getLogger(os.path.basename(model_dir))
|
||||
|
||||
@@ -96,7 +96,8 @@ class VC:
|
||||
{"value": to_return_protect[2], "__type__": "update"},
|
||||
{"value": to_return_protect[3], "__type__": "update"},
|
||||
{"value": "", "__type__": "update"},
|
||||
) if to_return_protect
|
||||
)
|
||||
if to_return_protect
|
||||
else {"visible": True, "maximum": 0, "__type__": "update"}
|
||||
)
|
||||
person = f'{os.getenv("weight_root")}/{sid}'
|
||||
|
||||
Reference in New Issue
Block a user