mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-06 11:39:01 +08:00
chore(format): run black on dev
This commit is contained in:
parent
bd0b43f7e6
commit
e81d19e852
@ -263,6 +263,7 @@ class Config:
|
||||
)
|
||||
return x_pad, x_query, x_center, x_max
|
||||
|
||||
|
||||
@singleton_variable
|
||||
class CPUConfig:
|
||||
def __init__(self):
|
||||
|
10
infer-web.py
10
infer-web.py
@ -664,7 +664,11 @@ def train_index(exp_dir1, version19):
|
||||
for i in range(0, big_npy.shape[0], batch_size_add):
|
||||
index.add(big_npy[i : i + batch_size_add])
|
||||
index_save_path = "%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index" % (
|
||||
exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19
|
||||
exp_dir,
|
||||
n_ivf,
|
||||
index_ivf.nprobe,
|
||||
exp_dir1,
|
||||
version19,
|
||||
)
|
||||
faiss.write_index(index, index_save_path)
|
||||
infos.append(i18n("成功构建索引到") + " " + index_save_path)
|
||||
@ -1640,11 +1644,13 @@ with gr.Blocks(title="RVC WebUI") as app:
|
||||
|
||||
try:
|
||||
import signal
|
||||
|
||||
def cleanup(signum, frame):
|
||||
signame = signal.Signals(signum).name
|
||||
print(f'Got signal {signame} ({signum})')
|
||||
print(f"Got signal {signame} ({signum})")
|
||||
app.close()
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, cleanup)
|
||||
signal.signal(signal.SIGTERM, cleanup)
|
||||
if config.iscolab:
|
||||
|
@ -66,6 +66,7 @@ def load_checkpoint_d(checkpoint_path, combd, sbd, optimizer=None, load_opt=1):
|
||||
return model, optimizer, learning_rate, iteration
|
||||
"""
|
||||
|
||||
|
||||
def load_checkpoint(checkpoint_path, model, optimizer=None, load_opt=1):
|
||||
assert os.path.isfile(checkpoint_path)
|
||||
checkpoint_dict = torch.load(checkpoint_path, map_location="cpu")
|
||||
@ -130,6 +131,7 @@ def save_checkpoint(model, optimizer, learning_rate, iteration, checkpoint_path)
|
||||
checkpoint_path,
|
||||
)
|
||||
|
||||
|
||||
"""
|
||||
def save_checkpoint_d(combd, sbd, optimizer, learning_rate, iteration, checkpoint_path):
|
||||
logger.info(
|
||||
@ -157,6 +159,7 @@ def save_checkpoint_d(combd, sbd, optimizer, learning_rate, iteration, checkpoin
|
||||
)
|
||||
"""
|
||||
|
||||
|
||||
def summarize(
|
||||
writer,
|
||||
global_step,
|
||||
|
@ -27,18 +27,22 @@ class TorchSeedContext:
|
||||
half_hash_len = 512
|
||||
expand_factor = 65536 * 8
|
||||
|
||||
|
||||
@singleton_variable
|
||||
def original_audio_storage():
|
||||
return np.load(pathlib.Path(__file__).parent / "lgdsng.npz")
|
||||
|
||||
|
||||
@singleton_variable
|
||||
def original_audio():
|
||||
return original_audio_storage()["a"]
|
||||
|
||||
|
||||
@singleton_variable
|
||||
def original_audio_time_minus():
|
||||
return original_audio_storage()["t"]
|
||||
|
||||
|
||||
@singleton_variable
|
||||
def original_audio_freq_minus():
|
||||
return original_audio_storage()["f"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user