Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
from speechbrain.pretrained import SepformerSeparation as separator
|
3 |
import torchaudio
|
4 |
import torch
|
5 |
import os
|
6 |
from pydub import AudioSegment
|
7 |
import tempfile
|
|
|
8 |
|
9 |
class AudioDenoiser:
|
10 |
def __init__(self):
|
11 |
# Initialize the SepFormer model for audio enhancement
|
12 |
-
self.model =
|
13 |
source="speechbrain/sepformer-dns4-16k-enhancement",
|
14 |
savedir='pretrained_models/sepformer-dns4-16k-enhancement'
|
15 |
)
|
@@ -98,8 +98,7 @@ def create_gradio_interface():
|
|
98 |
fn=denoiser.enhance_audio,
|
99 |
inputs=gr.Audio(
|
100 |
type="filepath",
|
101 |
-
label="Upload Noisy Audio"
|
102 |
-
source="upload"
|
103 |
),
|
104 |
outputs=gr.Audio(
|
105 |
label="Enhanced Audio",
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import torchaudio
|
3 |
import torch
|
4 |
import os
|
5 |
from pydub import AudioSegment
|
6 |
import tempfile
|
7 |
+
from speechbrain.pretrained.separation import SepformerSeparation
|
8 |
|
9 |
class AudioDenoiser:
|
10 |
def __init__(self):
|
11 |
# Initialize the SepFormer model for audio enhancement
|
12 |
+
self.model = SepformerSeparation.from_hparams(
|
13 |
source="speechbrain/sepformer-dns4-16k-enhancement",
|
14 |
savedir='pretrained_models/sepformer-dns4-16k-enhancement'
|
15 |
)
|
|
|
98 |
fn=denoiser.enhance_audio,
|
99 |
inputs=gr.Audio(
|
100 |
type="filepath",
|
101 |
+
label="Upload Noisy Audio"
|
|
|
102 |
),
|
103 |
outputs=gr.Audio(
|
104 |
label="Enhanced Audio",
|