Update app.py
Browse files
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
|
| 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="
|
| 66 |
-
outputs = gr.Audio(label="Enhanced Audio", type="
|
| 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>"
|