Spaces:
Runtime error
Runtime error
wangwx
commited on
Commit
•
795c10b
1
Parent(s):
93b49b3
update gradio component
Browse files- app.py +4 -4
- requirements.txt +1 -1
app.py
CHANGED
@@ -2,7 +2,7 @@ from speechbrain.pretrained import SepformerSeparation as separator
|
|
2 |
import torchaudio
|
3 |
import gradio as gr
|
4 |
|
5 |
-
model = separator.from_hparams(source="speechbrain/sepformer-wsj02mix", savedir='pretrained_models
|
6 |
|
7 |
def speechbrain(aud):
|
8 |
est_sources = model.separate_file(path=aud)
|
@@ -10,10 +10,10 @@ def speechbrain(aud):
|
|
10 |
torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000)
|
11 |
return "source1hat.wav", "source2hat.wav"
|
12 |
|
13 |
-
inputs = gr.
|
14 |
outputs = [
|
15 |
-
gr.
|
16 |
-
gr.
|
17 |
]
|
18 |
|
19 |
title = "Speech Seperation"
|
|
|
2 |
import torchaudio
|
3 |
import gradio as gr
|
4 |
|
5 |
+
model = separator.from_hparams(source="speechbrain/sepformer-wsj02mix", savedir='pretrained_models\sepformer-wsj02mix')
|
6 |
|
7 |
def speechbrain(aud):
|
8 |
est_sources = model.separate_file(path=aud)
|
|
|
10 |
torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000)
|
11 |
return "source1hat.wav", "source2hat.wav"
|
12 |
|
13 |
+
inputs = gr.components.Audio(label="Input Audio", type="filepath")
|
14 |
outputs = [
|
15 |
+
gr.components.Audio(label="Output Audio One", type="filepath"),
|
16 |
+
gr.components.Audio(label="Output Audio Two", type="filepath")
|
17 |
]
|
18 |
|
19 |
title = "Speech Seperation"
|
requirements.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
speechbrain == 0.5.16
|
2 |
torchaudio
|
3 |
-
gradio==
|
|
|
1 |
speechbrain == 0.5.16
|
2 |
torchaudio
|
3 |
+
gradio==4.27.0
|