diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb7cc89 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +__pycache__ +/TEMP +*.pyd +hubert_base.pt diff --git a/infer-web.py b/infer-web.py index cf0f242..5c5f017 100644 --- a/infer-web.py +++ b/infer-web.py @@ -64,9 +64,11 @@ def load_hubert(): weight_root="weights" weight_uvr5_root="uvr5_weights" names=[] -for name in os.listdir(weight_root):names.append(name) +for name in os.listdir(weight_root): + if name.endswith(".pt"): names.append(name) uvr5_names=[] -for name in os.listdir(weight_uvr5_root):uvr5_names.append(name.replace(".pth","")) +for name in os.listdir(weight_uvr5_root): + if name.endswith(".pth"): uvr5_names.append(name.replace(".pth","")) def vc_single(sid,input_audio,f0_up_key,f0_file,f0_method,file_index,file_big_npy,index_rate):#spk_item, input_audio0, vc_transform0,f0_file,f0method0 global tgt_sr,net_g,vc,hubert_model @@ -180,7 +182,10 @@ def get_vc(sid): n_spk=cpt["config"][-3] return {"visible": True,"maximum": n_spk, "__type__": "update"} -def change_choices():return {"choices": sorted(list(os.listdir(weight_root))), "__type__": "update"} +def change_choices(): + for name in os.listdir(weight_root): + if name.endswith(".pt"): names.append(name) + return {"choices": sorted(name), "__type__": "update"} def clean():return {"value": "", "__type__": "update"} def change_f0(if_f0_3,sr2):#np7, f0method8,pretrained_G14,pretrained_D15 if(if_f0_3=="是"):return {"visible": True, "__type__": "update"},{"visible": True, "__type__": "update"},"pretrained/f0G%s.pth"%sr2,"pretrained/f0D%s.pth"%sr2 @@ -443,7 +448,7 @@ with gr.Blocks() as app: with gr.Tabs(): with gr.TabItem("模型推理"): with gr.Row(): - sid0 = gr.Dropdown(label="推理音色", choices=names) + sid0 = gr.Dropdown(label="推理音色", choices=sorted(names)) refresh_button = gr.Button("刷新音色列表", variant="primary") refresh_button.click( fn=change_choices, @@ -625,6 +630,11 @@ with gr.Blocks() as app: with gr.TabItem("点击查看交流、问题反馈群号"): gr.Markdown(value="""xxxxx""") - # app.launch(server_name="0.0.0.0",server_port=7860) - # app.queue(concurrency_count=511, max_size=1022).launch(server_name="127.0.0.1",inbrowser=True,server_port=7861,quiet=True) - app.queue(concurrency_count=511, max_size=1022).launch(server_name="0.0.0.0",inbrowser=True,server_port=7865,quiet=True) \ No newline at end of file + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--colab", type=bool, default=False, help="Launch in colab") + cmd_opts = parser.parse_args() + if cmd_opts.colab: + app.launch(share=True) + else: + app.queue(concurrency_count=511, max_size=1022).launch(server_name="0.0.0.0",inbrowser=True,server_port=7865,quiet=True) diff --git a/infer_pack/__pycache__/attentions.cpython-39.pyc b/infer_pack/__pycache__/attentions.cpython-39.pyc deleted file mode 100644 index 6073f25..0000000 Binary files a/infer_pack/__pycache__/attentions.cpython-39.pyc and /dev/null differ diff --git a/infer_pack/__pycache__/commons.cpython-39.pyc b/infer_pack/__pycache__/commons.cpython-39.pyc deleted file mode 100644 index de9f06c..0000000 Binary files a/infer_pack/__pycache__/commons.cpython-39.pyc and /dev/null differ diff --git a/infer_pack/__pycache__/models.cpython-39.pyc b/infer_pack/__pycache__/models.cpython-39.pyc deleted file mode 100644 index 068c8c5..0000000 Binary files a/infer_pack/__pycache__/models.cpython-39.pyc and /dev/null differ diff --git a/infer_pack/__pycache__/modules.cpython-39.pyc b/infer_pack/__pycache__/modules.cpython-39.pyc deleted file mode 100644 index b5d62e1..0000000 Binary files a/infer_pack/__pycache__/modules.cpython-39.pyc and /dev/null differ diff --git a/infer_pack/__pycache__/transforms.cpython-39.pyc b/infer_pack/__pycache__/transforms.cpython-39.pyc deleted file mode 100644 index 2676b31..0000000 Binary files a/infer_pack/__pycache__/transforms.cpython-39.pyc and /dev/null differ diff --git a/my_utils.py b/my_utils.py index 48a93b6..c82c754 100644 --- a/my_utils.py +++ b/my_utils.py @@ -1,4 +1,5 @@ -import ffmpeg,numpy as np +import ffmpeg +import numpy as np def load_audio(file,sr): try: # https://github.com/openai/whisper/blob/main/whisper/audio.py#L26 diff --git a/pretrained/.gitignore b/pretrained/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/pretrained/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/train/__pycache__/data_utils.cpython-39.pyc b/train/__pycache__/data_utils.cpython-39.pyc deleted file mode 100644 index c3cbe4c..0000000 Binary files a/train/__pycache__/data_utils.cpython-39.pyc and /dev/null differ diff --git a/train/__pycache__/losses.cpython-39.pyc b/train/__pycache__/losses.cpython-39.pyc deleted file mode 100644 index bb61e47..0000000 Binary files a/train/__pycache__/losses.cpython-39.pyc and /dev/null differ diff --git a/train/__pycache__/mel_processing.cpython-39.pyc b/train/__pycache__/mel_processing.cpython-39.pyc deleted file mode 100644 index d2310c5..0000000 Binary files a/train/__pycache__/mel_processing.cpython-39.pyc and /dev/null differ diff --git a/train/__pycache__/process_ckpt.cpython-39.pyc b/train/__pycache__/process_ckpt.cpython-39.pyc deleted file mode 100644 index b70104a..0000000 Binary files a/train/__pycache__/process_ckpt.cpython-39.pyc and /dev/null differ diff --git a/train/__pycache__/utils.cpython-39.pyc b/train/__pycache__/utils.cpython-39.pyc deleted file mode 100644 index 7a6f49c..0000000 Binary files a/train/__pycache__/utils.cpython-39.pyc and /dev/null differ diff --git a/uvr5_pack/__pycache__/utils.cpython-39.pyc b/uvr5_pack/__pycache__/utils.cpython-39.pyc deleted file mode 100644 index eff88c5..0000000 Binary files a/uvr5_pack/__pycache__/utils.cpython-39.pyc and /dev/null differ diff --git a/uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-39.pyc b/uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-39.pyc deleted file mode 100644 index a8ec492..0000000 Binary files a/uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-39.pyc and /dev/null differ diff --git a/uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-39.pyc b/uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-39.pyc deleted file mode 100644 index cb0c984..0000000 Binary files a/uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-39.pyc and /dev/null differ diff --git a/uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-39.pyc b/uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-39.pyc deleted file mode 100644 index b13e91d..0000000 Binary files a/uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-39.pyc and /dev/null differ diff --git a/uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-39.pyc b/uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-39.pyc deleted file mode 100644 index 2a1ca01..0000000 Binary files a/uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-39.pyc and /dev/null differ diff --git a/uvr5_weights/.gitignore b/uvr5_weights/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/uvr5_weights/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/weights/... b/weights/... deleted file mode 100644 index 8b13789..0000000 --- a/weights/... +++ /dev/null @@ -1 +0,0 @@ - diff --git a/weights/.gitignore b/weights/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/weights/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore