Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import io
|
2 |
import os
|
3 |
|
4 |
-
os.system("wget -P cvec/ https://huggingface.co/spaces/
|
5 |
import gradio as gr
|
6 |
import librosa
|
7 |
import numpy as np
|
@@ -19,7 +19,8 @@ config_path = "configs/config.json"
|
|
19 |
model = Svc("logs/44k/G_99200.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
|
20 |
|
21 |
|
22 |
-
|
|
|
23 |
if input_audio is None:
|
24 |
return "You need to upload an audio", None
|
25 |
sampling_rate, audio = input_audio
|
@@ -37,13 +38,13 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, noise_scale):
|
|
37 |
soundfile.write(out_wav_path, audio, 16000, format="wav")
|
38 |
print( cluster_ratio, auto_f0, noise_scale)
|
39 |
_audio = model.slice_inference(out_wav_path, sid, vc_transform, slice_db, cluster_ratio, auto_f0, noise_scale)
|
40 |
-
return "
|
41 |
|
42 |
|
43 |
app = gr.Blocks()
|
44 |
with app:
|
45 |
with gr.Tabs():
|
46 |
-
with gr.TabItem("
|
47 |
gr.Markdown(value="""
|
48 |
星瞳_Official的语音在线合成,基于so-vits-svc-4.0生成。\n
|
49 |
|
@@ -73,3 +74,6 @@ with app:
|
|
73 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
|
74 |
|
75 |
app.launch()
|
|
|
|
|
|
|
|
1 |
import io
|
2 |
import os
|
3 |
|
4 |
+
# os.system("wget -P cvec/ https://huggingface.co/spaces/innnky/nanami/resolve/main/checkpoint_best_legacy_500.pt")
|
5 |
import gradio as gr
|
6 |
import librosa
|
7 |
import numpy as np
|
|
|
19 |
model = Svc("logs/44k/G_99200.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
|
20 |
|
21 |
|
22 |
+
|
23 |
+
def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise_scale):
|
24 |
if input_audio is None:
|
25 |
return "You need to upload an audio", None
|
26 |
sampling_rate, audio = input_audio
|
|
|
38 |
soundfile.write(out_wav_path, audio, 16000, format="wav")
|
39 |
print( cluster_ratio, auto_f0, noise_scale)
|
40 |
_audio = model.slice_inference(out_wav_path, sid, vc_transform, slice_db, cluster_ratio, auto_f0, noise_scale)
|
41 |
+
return "Success", (44100, _audio)
|
42 |
|
43 |
|
44 |
app = gr.Blocks()
|
45 |
with app:
|
46 |
with gr.Tabs():
|
47 |
+
with gr.TabItem("Basic"):
|
48 |
gr.Markdown(value="""
|
49 |
星瞳_Official的语音在线合成,基于so-vits-svc-4.0生成。\n
|
50 |
|
|
|
74 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
|
75 |
|
76 |
app.launch()
|
77 |
+
|
78 |
+
|
79 |
+
|