mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-05 09:10:25 +08:00
Compare commits
1 Commits
main
...
f4df04a5af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4df04a5af |
2
.github/workflows/close-issue.yml
vendored
2
.github/workflows/close-issue.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
exempt-issue-labels: "help wanted,good first issue,documentation,following up,todo list,enhancement"
|
||||
exempt-issue-labels: "help wanted,good first issue,documentation,following up,todo list"
|
||||
days-before-issue-stale: 30
|
||||
days-before-issue-close: 15
|
||||
stale-issue-label: "stale"
|
||||
|
||||
@@ -29,24 +29,6 @@ def load_checkpoint(checkpoint_path, model, optimizer=None, load_opt=1):
|
||||
checkpoint_dict = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
|
||||
|
||||
saved_state_dict = checkpoint_dict["model"]
|
||||
# Convert old-style weight_norm keys (weight_g/weight_v) to new
|
||||
# parametrizations format (parametrizations.weight.original0/original1)
|
||||
# so that checkpoints saved with the deprecated API can still be loaded.
|
||||
_converted = {}
|
||||
for k, v in list(saved_state_dict.items()):
|
||||
if k.endswith(".weight_g"):
|
||||
new_key = k[: -len(".weight_g")] + ".parametrizations.weight.original0"
|
||||
_converted[new_key] = v
|
||||
elif k.endswith(".weight_v"):
|
||||
new_key = k[: -len(".weight_v")] + ".parametrizations.weight.original1"
|
||||
_converted[new_key] = v
|
||||
if _converted:
|
||||
logger.info(
|
||||
"Converting %d old-style weight_norm keys from checkpoint to new parametrizations format",
|
||||
len(_converted),
|
||||
)
|
||||
saved_state_dict.update(_converted)
|
||||
|
||||
if hasattr(model, "module"):
|
||||
state_dict = model.module.state_dict()
|
||||
else:
|
||||
|
||||
@@ -29,12 +29,10 @@ try:
|
||||
|
||||
GradScaler = gradscaler_init()
|
||||
ipex_init()
|
||||
else:
|
||||
from torch.cuda.amp import GradScaler, autocast
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
if not ("GradScaler" in globals() and "autocast" in globals()):
|
||||
from torch.amp.grad_scaler import GradScaler
|
||||
from torch.amp.autocast_mode import autocast
|
||||
from torch.cuda.amp import GradScaler, autocast
|
||||
|
||||
torch.backends.cudnn.deterministic = False
|
||||
torch.backends.cudnn.benchmark = False
|
||||
@@ -537,7 +535,7 @@ def train_and_evaluate(
|
||||
# wave_lengths = wave_lengths.cuda(rank, non_blocking=True)
|
||||
|
||||
# Calculate
|
||||
with autocast(device_type="cuda", enabled=hps.train.fp16_run):
|
||||
with autocast(enabled=hps.train.fp16_run):
|
||||
(
|
||||
y_hat,
|
||||
ids_slice,
|
||||
@@ -556,7 +554,7 @@ def train_and_evaluate(
|
||||
y_mel = slice_on_last_dim(
|
||||
mel, ids_slice, hps.train.segment_size // hps.data.hop_length
|
||||
)
|
||||
with autocast(device_type="cuda", enabled=False):
|
||||
with autocast(enabled=False):
|
||||
y_hat_mel = mel_spectrogram_torch(
|
||||
y_hat.float().squeeze(1),
|
||||
hps.data.filter_length,
|
||||
@@ -575,7 +573,7 @@ def train_and_evaluate(
|
||||
|
||||
# Discriminator
|
||||
y_d_hat_r, y_d_hat_g, _, _ = net_d(wave, y_hat.detach())
|
||||
with autocast(device_type="cuda", enabled=False):
|
||||
with autocast(enabled=False):
|
||||
loss_disc, losses_disc_r, losses_disc_g = discriminator_loss(
|
||||
y_d_hat_r, y_d_hat_g
|
||||
)
|
||||
@@ -585,10 +583,10 @@ def train_and_evaluate(
|
||||
grad_norm_d = total_grad_norm(net_d.parameters())
|
||||
scaler.step(optim_d)
|
||||
|
||||
with autocast(device_type="cuda", enabled=hps.train.fp16_run):
|
||||
with autocast(enabled=hps.train.fp16_run):
|
||||
# Generator
|
||||
y_d_hat_r, y_d_hat_g, fmap_r, fmap_g = net_d(wave, y_hat)
|
||||
with autocast(device_type="cuda", enabled=False):
|
||||
with autocast(enabled=False):
|
||||
loss_mel = F.l1_loss(y_mel, y_hat_mel) * hps.train.c_mel
|
||||
loss_kl = kl_loss(z_p, logs_q, m_p, logs_p, z_mask) * hps.train.c_kl
|
||||
loss_fm = feature_loss(fmap_r, fmap_g)
|
||||
|
||||
@@ -10,6 +10,9 @@ from pybase16384 import encode_to_string, decode_from_string
|
||||
from configs import CPUConfig
|
||||
from rvc.synthesizer import get_synthesizer
|
||||
|
||||
from .pipeline import Pipeline
|
||||
from .utils import load_hubert
|
||||
|
||||
|
||||
class TorchSeedContext:
|
||||
def __init__(self, seed):
|
||||
@@ -92,9 +95,6 @@ def wave_hash(time_field):
|
||||
|
||||
|
||||
def model_hash(config, tgt_sr, net_g, if_f0, version):
|
||||
from .pipeline import Pipeline
|
||||
from .utils import load_hubert
|
||||
|
||||
pipeline = Pipeline(tgt_sr, config)
|
||||
audio = original_audio()
|
||||
hbt = load_hubert(config.device, config.is_half)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os, pathlib
|
||||
|
||||
import torch
|
||||
from fairseq import checkpoint_utils, data
|
||||
from fairseq import checkpoint_utils
|
||||
|
||||
|
||||
def get_index_path_from_model(sid):
|
||||
@@ -22,11 +21,10 @@ def get_index_path_from_model(sid):
|
||||
|
||||
|
||||
def load_hubert(device, is_half):
|
||||
with torch.serialization.safe_globals([data.dictionary.Dictionary]):
|
||||
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
||||
["assets/hubert/hubert_base.pt"],
|
||||
suffix="",
|
||||
)
|
||||
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
||||
["assets/hubert/hubert_base.pt"],
|
||||
suffix="",
|
||||
)
|
||||
hubert_model = models[0]
|
||||
hubert_model = hubert_model.to(device)
|
||||
if is_half:
|
||||
|
||||
@@ -4,8 +4,7 @@ import torch
|
||||
from torch import nn
|
||||
from torch.nn import Conv1d, Conv2d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils import spectral_norm
|
||||
from torch.nn.utils.parametrizations import weight_norm
|
||||
from torch.nn.utils import spectral_norm, weight_norm
|
||||
|
||||
from .residuals import LRELU_SLOPE
|
||||
from .utils import get_padding
|
||||
|
||||
@@ -212,8 +212,10 @@ class PosteriorEncoder(nn.Module):
|
||||
self.enc.remove_weight_norm()
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
from torch.nn.utils import parametrize
|
||||
|
||||
if parametrize.is_parametrized(self.enc, "weight"):
|
||||
parametrize.remove_parametrizations(self.enc, "weight")
|
||||
for hook in self.enc._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.enc)
|
||||
return self
|
||||
|
||||
@@ -4,8 +4,7 @@ import torch
|
||||
from torch import nn
|
||||
from torch.nn import Conv1d, ConvTranspose1d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils.parametrizations import weight_norm
|
||||
from torch.nn.utils.parametrize import is_parametrized, remove_parametrizations
|
||||
from torch.nn.utils import remove_weight_norm, weight_norm
|
||||
|
||||
from .residuals import ResBlock1, ResBlock2, LRELU_SLOPE
|
||||
from .utils import call_weight_data_normal_if_Conv
|
||||
@@ -99,16 +98,29 @@ class Generator(torch.nn.Module):
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
for l in self.ups:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
# The hook we want to remove is an instance of WeightNorm class, so
|
||||
# normally we would do `if isinstance(...)` but this class is not accessible
|
||||
# because of shadowing, so we check the module name directly.
|
||||
# https://github.com/pytorch/pytorch/blob/be0ca00c5ce260eb5bcec3237357f7a30cc08983/torch/nn/utils/__init__.py#L3
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
|
||||
for l in self.resblocks:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
return self
|
||||
|
||||
def remove_weight_norm(self):
|
||||
for l in self.ups:
|
||||
remove_parametrizations(l, "weight")
|
||||
remove_weight_norm(l)
|
||||
for l in self.resblocks:
|
||||
l.remove_weight_norm()
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ from torch.nn import functional as F
|
||||
|
||||
from .utils import activate_add_tanh_sigmoid_multiply
|
||||
|
||||
from torch.nn.utils.parametrize import is_parametrized, remove_parametrizations
|
||||
|
||||
|
||||
class LayerNorm(nn.Module):
|
||||
def __init__(self, channels: int, eps: float = 1e-5):
|
||||
@@ -51,9 +49,7 @@ class WN(torch.nn.Module):
|
||||
cond_layer = torch.nn.Conv1d(
|
||||
gin_channels, 2 * hidden_channels * n_layers, 1
|
||||
)
|
||||
self.cond_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||
cond_layer, name="weight"
|
||||
)
|
||||
self.cond_layer = torch.nn.utils.weight_norm(cond_layer, name="weight")
|
||||
|
||||
for i in range(n_layers):
|
||||
dilation = dilation_rate**i
|
||||
@@ -65,9 +61,7 @@ class WN(torch.nn.Module):
|
||||
dilation=dilation,
|
||||
padding=padding,
|
||||
)
|
||||
in_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||
in_layer, name="weight"
|
||||
)
|
||||
in_layer = torch.nn.utils.weight_norm(in_layer, name="weight")
|
||||
self.in_layers.append(in_layer)
|
||||
|
||||
# last one is not necessary
|
||||
@@ -77,9 +71,7 @@ class WN(torch.nn.Module):
|
||||
res_skip_channels = hidden_channels
|
||||
|
||||
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
|
||||
res_skip_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||
res_skip_layer, name="weight"
|
||||
)
|
||||
res_skip_layer = torch.nn.utils.weight_norm(res_skip_layer, name="weight")
|
||||
self.res_skip_layers.append(res_skip_layer)
|
||||
|
||||
def __call__(
|
||||
@@ -125,20 +117,32 @@ class WN(torch.nn.Module):
|
||||
|
||||
def remove_weight_norm(self):
|
||||
if self.gin_channels != 0:
|
||||
remove_parametrizations(self.cond_layer, "weight")
|
||||
torch.nn.utils.remove_weight_norm(self.cond_layer)
|
||||
for l in self.in_layers:
|
||||
remove_parametrizations(l, "weight")
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
for l in self.res_skip_layers:
|
||||
remove_parametrizations(l, "weight")
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
if self.gin_channels != 0:
|
||||
if is_parametrized(self.cond_layer, "weight"):
|
||||
remove_parametrizations(self.cond_layer, "weight")
|
||||
for hook in self.cond_layer._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.cond_layer)
|
||||
for l in self.in_layers:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
for l in self.res_skip_layers:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
return self
|
||||
|
||||
@@ -5,8 +5,7 @@ import torch
|
||||
from torch import nn
|
||||
from torch.nn import Conv1d, ConvTranspose1d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils.parametrizations import weight_norm
|
||||
from torch.nn.utils.parametrize import is_parametrized, remove_parametrizations
|
||||
from torch.nn.utils import remove_weight_norm, weight_norm
|
||||
|
||||
from .generators import SineGenerator
|
||||
from .residuals import ResBlock1, ResBlock2, LRELU_SLOPE
|
||||
@@ -192,15 +191,27 @@ class NSFGenerator(torch.nn.Module):
|
||||
|
||||
def remove_weight_norm(self):
|
||||
for l in self.ups:
|
||||
remove_parametrizations(l, "weight")
|
||||
remove_weight_norm(l)
|
||||
for l in self.resblocks:
|
||||
l.remove_weight_norm()
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
for l in self.ups:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
# The hook we want to remove is an instance of WeightNorm class, so
|
||||
# normally we would do `if isinstance(...)` but this class is not accessible
|
||||
# because of shadowing, so we check the module name directly.
|
||||
# https://github.com/pytorch/pytorch/blob/be0ca00c5ce260eb5bcec3237357f7a30cc08983/torch/nn/utils/__init__.py#L3
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
for l in self.resblocks:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in self.resblocks._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
return self
|
||||
|
||||
@@ -4,8 +4,7 @@ import torch
|
||||
from torch import nn
|
||||
from torch.nn import Conv1d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils.parametrizations import weight_norm
|
||||
from torch.nn.utils.parametrize import is_parametrized, remove_parametrizations
|
||||
from torch.nn.utils import remove_weight_norm, weight_norm
|
||||
|
||||
from .norms import WN
|
||||
from .utils import (
|
||||
@@ -86,17 +85,25 @@ class ResBlock1(torch.nn.Module):
|
||||
|
||||
def remove_weight_norm(self):
|
||||
for l in self.convs1:
|
||||
remove_parametrizations(l, "weight")
|
||||
remove_weight_norm(l)
|
||||
for l in self.convs2:
|
||||
remove_parametrizations(l, "weight")
|
||||
remove_weight_norm(l)
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
for l in self.convs1:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
for l in self.convs2:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
return self
|
||||
|
||||
|
||||
@@ -154,12 +161,16 @@ class ResBlock2(torch.nn.Module):
|
||||
|
||||
def remove_weight_norm(self):
|
||||
for l in self.convs:
|
||||
remove_parametrizations(l, "weight")
|
||||
remove_weight_norm(l)
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
for l in self.convs:
|
||||
if is_parametrized(l, "weight"):
|
||||
remove_parametrizations(l, "weight")
|
||||
for hook in l._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(l)
|
||||
return self
|
||||
|
||||
|
||||
@@ -238,8 +249,12 @@ class ResidualCouplingLayer(nn.Module):
|
||||
self.enc.remove_weight_norm()
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
if is_parametrized(self.enc, "weight"):
|
||||
remove_parametrizations(self.enc, "weight")
|
||||
for hook in self.enc._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.enc)
|
||||
return self
|
||||
|
||||
|
||||
@@ -329,6 +344,10 @@ class ResidualCouplingBlock(nn.Module):
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
for i in range(self.n_flows):
|
||||
if is_parametrized(self.flows[i * 2], "weight"):
|
||||
remove_parametrizations(self.flows[i * 2], "weight")
|
||||
for hook in self.flows[i * 2]._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.flows[i * 2])
|
||||
return self
|
||||
|
||||
@@ -2,7 +2,6 @@ from typing import Optional, List, Union
|
||||
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn.utils import parametrize
|
||||
|
||||
|
||||
from .encoders import TextEncoder, PosteriorEncoder
|
||||
@@ -119,13 +118,29 @@ class SynthesizerTrnMsNSFsid(nn.Module):
|
||||
self.enc_q.remove_weight_norm()
|
||||
|
||||
def __prepare_scriptable__(self):
|
||||
if parametrize.is_parametrized(self.dec, "weight"):
|
||||
parametrize.remove_parametrizations(self.dec, "weight")
|
||||
if parametrize.is_parametrized(self.flow, "weight"):
|
||||
parametrize.remove_parametrizations(self.flow, "weight")
|
||||
for hook in self.dec._forward_pre_hooks.values():
|
||||
# The hook we want to remove is an instance of WeightNorm class, so
|
||||
# normally we would do `if isinstance(...)` but this class is not accessible
|
||||
# because of shadowing, so we check the module name directly.
|
||||
# https://github.com/pytorch/pytorch/blob/be0ca00c5ce260eb5bcec3237357f7a30cc08983/torch/nn/utils/__init__.py#L3
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.dec)
|
||||
for hook in self.flow._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.flow)
|
||||
if hasattr(self, "enc_q"):
|
||||
if parametrize.is_parametrized(self.enc_q, "weight"):
|
||||
parametrize.remove_parametrizations(self.enc_q, "weight")
|
||||
for hook in self.enc_q._forward_pre_hooks.values():
|
||||
if (
|
||||
hook.__module__ == "torch.nn.utils.weight_norm"
|
||||
and hook.__class__.__name__ == "WeightNorm"
|
||||
):
|
||||
torch.nn.utils.remove_weight_norm(self.enc_q)
|
||||
return self
|
||||
|
||||
@torch.jit.ignore()
|
||||
|
||||
19
web.py
19
web.py
@@ -88,24 +88,23 @@ index_paths = [""]
|
||||
|
||||
|
||||
def lookup_names(weight_root):
|
||||
names = []
|
||||
global names
|
||||
for name in os.listdir(weight_root):
|
||||
if name.endswith(".pth"):
|
||||
names.append(name)
|
||||
return names
|
||||
|
||||
|
||||
def lookup_indices(index_root):
|
||||
index_paths = []
|
||||
global index_paths
|
||||
for root, _, files in os.walk(index_root, topdown=False):
|
||||
for name in files:
|
||||
if name.endswith(".index") and "trained" not in name:
|
||||
index_paths.append(str(pathlib.Path(root, name)))
|
||||
return index_paths
|
||||
|
||||
|
||||
names = [""] + lookup_names(weight_root)
|
||||
index_paths = [""] + lookup_indices(index_root) + lookup_indices(outside_index_root)
|
||||
lookup_names(weight_root)
|
||||
lookup_indices(index_root)
|
||||
lookup_indices(outside_index_root)
|
||||
uvr5_names = []
|
||||
for name in os.listdir(weight_uvr5_root):
|
||||
if name.endswith(".pth") or "onnx" in name:
|
||||
@@ -113,8 +112,12 @@ for name in os.listdir(weight_uvr5_root):
|
||||
|
||||
|
||||
def change_choices():
|
||||
names = [""] + lookup_names(weight_root)
|
||||
index_paths = [""] + lookup_indices(index_root) + lookup_indices(outside_index_root)
|
||||
global index_paths, names
|
||||
names = [""]
|
||||
lookup_names(weight_root)
|
||||
index_paths = [""]
|
||||
lookup_indices(index_root)
|
||||
lookup_indices(outside_index_root)
|
||||
return {"choices": sorted(names), "__type__": "update"}, {
|
||||
"choices": sorted(index_paths),
|
||||
"__type__": "update",
|
||||
|
||||
Reference in New Issue
Block a user