Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ logging.getLogger('matplotlib').setLevel(logging.WARNING)
|
|
16 |
|
17 |
model = Svc("logs/44k/G_199200.pth", "logs/44k/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
|
18 |
|
19 |
-
def predict(input_audio,
|
20 |
if input_audio is None:
|
21 |
return "You need to upload an audio", None
|
22 |
sampling_rate, audio = input_audio
|
@@ -38,13 +38,16 @@ def predict(input_audio, vc_transform, not_singing,cluster_ratio, noise_scale):
|
|
38 |
)
|
39 |
return (44100, out_audio.numpy())
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
with app:
|
44 |
-
audio_input = gr.Audio(label="Upload Audio")
|
45 |
-
not_singing = gr.Checkbox(label="Check this box if this audio is not singing", value=False)
|
46 |
-
audio_output = gr.Audio(label="Output Audio")
|
47 |
-
submit_btn = gr.Button("Submit", variant="primary")
|
48 |
-
submit_btn.click(predict, [audio_input, not_singing], [audio_output], api_name="predict")
|
49 |
-
|
50 |
-
app.launch()
|
|
|
16 |
|
17 |
model = Svc("logs/44k/G_199200.pth", "logs/44k/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
|
18 |
|
19 |
+
def predict(input_audio, not_singing):
|
20 |
if input_audio is None:
|
21 |
return "You need to upload an audio", None
|
22 |
sampling_rate, audio = input_audio
|
|
|
38 |
)
|
39 |
return (44100, out_audio.numpy())
|
40 |
|
41 |
+
audio_input = gr.Audio(label="Upload Audio")
|
42 |
+
not_singing = gr.Checkbox(label="Check this box if this audio is not singing", value=False)
|
43 |
+
audio_output = gr.Audio(label="Output Audio")
|
44 |
+
demo = gr.Interface(predict, inputs=[audio_input, not_singing], outputs=[audio_output])
|
45 |
+
# app = gr.Blocks()
|
46 |
+
# with app:
|
47 |
+
# audio_input = gr.Audio(label="Upload Audio")
|
48 |
+
# not_singing = gr.Checkbox(label="Check this box if this audio is not singing", value=False)
|
49 |
+
# audio_output = gr.Audio(label="Output Audio")
|
50 |
+
# submit_btn = gr.Button("Submit", variant="primary")
|
51 |
+
# submit_btn.click(predict, [audio_input, not_singing], [audio_output], api_name="predict")
|
52 |
|
53 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|