Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,7 @@ model = ScoreModel.load_from_checkpoint("pretrained_checkpoints/speech_enhanceme
|
|
9 |
|
10 |
def enhance_speech(audio_file):
|
11 |
# Load and process the audio file
|
12 |
-
|
13 |
-
noisy = noisy.unsqueeze(0) # Add fake batch dimension if needed
|
14 |
-
|
15 |
-
if sr != target_sr:
|
16 |
-
y = torch.tensor(resample(y.numpy(), orig_sr=sr, target_sr=target_sr))
|
17 |
|
18 |
T_orig = y.size(1)
|
19 |
|
|
|
9 |
|
10 |
def enhance_speech(audio_file):
|
11 |
# Load and process the audio file
|
12 |
+
y, sr = torchaudio.load(audio_file)
|
|
|
|
|
|
|
|
|
13 |
|
14 |
T_orig = y.size(1)
|
15 |
|