Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NaruseMioShirakana authored Mar 10, 2023
1 parent 120444b commit 5b24974
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 1,319 deletions.
97 changes: 28 additions & 69 deletions configs/config.json
Original file line number Diff line number Diff line change
@@ -1,103 +1,62 @@
{
"train": {
"log_interval": 50,
"eval_interval": 1000,
"log_interval": 200,
"eval_interval": 800,
"seed": 1234,
"port": 8001,
"epochs": 10000,
"learning_rate": 0.0002,
"learning_rate": 0.0001,
"betas": [
0.8,
0.99
],
"eps": 1e-09,
"batch_size": 6,
"accumulation_steps": 1,
"fp16_run": false,
"lr_decay": 0.998,
"lr_decay": 0.999875,
"segment_size": 10240,
"init_lr_ratio": 1,
"warmup_epochs": 0,
"c_mel": 45,
"keep_ckpts":4
"c_kl": 1.0,
"use_sr": true,
"max_speclen": 512,
"port": "8001",
"keep_ckpts": 3
},
"data": {
"data_dir": "dataset",
"dataset_type": "SingDataset",
"collate_type": "SingCollate",
"training_filelist": "filelists/train.txt",
"validation_filelist": "filelists/val.txt",
"training_files": "filelists/train.txt",
"validation_files": "filelists/val.txt",
"max_wav_value": 32768.0,
"sampling_rate": 44100,
"n_fft": 2048,
"fmin": 0,
"fmax": 22050,
"filter_length": 2048,
"hop_length": 512,
"win_size": 2048,
"acoustic_dim": 80,
"c_dim": 256,
"min_level_db": -115,
"ref_level_db": 20,
"min_db": -115,
"max_abs_value": 4.0,
"n_speakers": 200
"win_length": 2048,
"n_mel_channels": 80,
"mel_fmin": 0.0,
"mel_fmax": 22050
},
"model": {
"inter_channels": 192,
"hidden_channels": 192,
"spk_channels": 192,
"filter_channels": 768,
"n_heads": 2,
"n_layers": 4,
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0.1,
"prior_hidden_channels": 192,
"prior_filter_channels": 768,
"prior_n_heads": 2,
"prior_n_layers": 4,
"prior_kernel_size": 3,
"prior_p_dropout": 0.1,
"resblock": "1",
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [ 8, 8, 2, 2, 2],
"upsample_initial_channel": 512,
"upsample_kernel_sizes": [16,16, 4, 4, 4],
"n_layers_q": 3,
"use_spectral_norm": false,
"resblock_kernel_sizes": [
3,
7,
11
],
"resblock_dilation_sizes": [
[
1,
3,
5
],
[
1,
3,
5
],
[
1,
3,
5
]
],
"upsample_rates": [
8,
8,
4,
2
],
"upsample_initial_channel": 256,
"upsample_kernel_sizes": [
16,
16,
8,
4
],
"n_harmonic": 64,
"n_bands": 65
"gin_channels": 256,
"ssl_dim": 256,
"n_speakers": 200
},
"spk": {
"jishuang": 0,
"nyaru": 0,
"huiyu": 1,
"nen": 2,
"paimon": 3,
Expand Down
7 changes: 4 additions & 3 deletions inference/infer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ def __init__(self, net_g_path, config_path,
def load_model(self):
# 获取模型配置
self.net_g_ms = SynthesizerTrn(
self.hps_ms
)
self.hps_ms.data.filter_length // 2 + 1,
self.hps_ms.train.segment_size // self.hps_ms.data.hop_length,
**self.hps_ms.model)
_ = utils.load_checkpoint(self.net_g_path, self.net_g_ms, None)
if "half" in self.net_g_path and torch.cuda.is_available():
_ = self.net_g_ms.half().eval().to(self.dev)
Expand Down Expand Up @@ -173,7 +174,7 @@ def infer(self, speaker, tran, raw_path,
c = c.half()
with torch.no_grad():
start = time.time()
audio = self.net_g_ms.infer(c, f0=f0, g=sid, uv=uv, predict_f0=auto_predict_f0, noice_scale=noice_scale)[0][0,0].data.float()
audio = self.net_g_ms.infer(c, f0=f0, g=sid, uv=uv, predict_f0=auto_predict_f0, noice_scale=noice_scale)[0,0].data.float()
use_time = time.time() - start
print("vits use time:{}".format(use_time))
return audio, audio.shape[-1]
Expand Down
Loading

0 comments on commit 5b24974

Please sign in to comment.