Spaces:

Shokoufehhh commited on
Commit
e6e1f50
1 Parent(s): a297d3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
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
- noisy, sr = torchaudio.load(audio_file)
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