Shokoufehhh commited on
Commit
793652a
·
verified ·
1 Parent(s): 88efd7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ def enhance_speech(audio_file):
25
  start_time = time.time() # Start the timer
26
 
27
  # Load and process the audio file
28
- y, sr = torchaudio.load(audio_file.name) # Gradio passes the file as a file-like object
29
  print(f"Loaded audio in {time.time() - start_time:.2f}s")
30
  T_orig = y.size(1)
31
 
@@ -62,8 +62,8 @@ def enhance_speech(audio_file):
62
  return output_file
63
 
64
  # Gradio interface setup
65
- inputs = gr.Audio(label="Input Audio", type="file") # Adjusted for file input
66
- outputs = gr.Audio(label="Enhanced Audio", type="file") # Output as file
67
  title = "Speech Enhancement using SGMSE"
68
  description = "This Gradio demo uses the SGMSE model for speech enhancement. Upload your audio file to enhance it."
69
  article = "<p style='text-align: center'><a href='https://huggingface.co/SP-UHH/speech-enhancement-sgmse' target='_blank'>Model Card</a></p>"
 
25
  start_time = time.time() # Start the timer
26
 
27
  # Load and process the audio file
28
+ y, sr = torchaudio.load(audio_file) # Gradio passes the file path
29
  print(f"Loaded audio in {time.time() - start_time:.2f}s")
30
  T_orig = y.size(1)
31
 
 
62
  return output_file
63
 
64
  # Gradio interface setup
65
+ inputs = gr.Audio(label="Input Audio", type="filepath") # Adjusted to 'filepath'
66
+ outputs = gr.Audio(label="Enhanced Audio", type="filepath") # Output as filepath
67
  title = "Speech Enhancement using SGMSE"
68
  description = "This Gradio demo uses the SGMSE model for speech enhancement. Upload your audio file to enhance it."
69
  article = "<p style='text-align: center'><a href='https://huggingface.co/SP-UHH/speech-enhancement-sgmse' target='_blank'>Model Card</a></p>"