musdfakoc commited on
Commit
c756113
·
verified ·
1 Parent(s): dd34179

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -194,8 +194,11 @@ def generate_audio_from_image(image):
194
  # Convert the generated spectrogram to audio
195
  generated_audio = spectrogram_to_audio(generated_spectrogram.squeeze(0).cpu())
196
 
197
- # Return the audio as (sample_rate, audio) tuple for Gradio to process
198
- return (sample_rate, generated_audio)
 
 
 
199
 
200
 
201
  # Gradio Interface
 
194
  # Convert the generated spectrogram to audio
195
  generated_audio = spectrogram_to_audio(generated_spectrogram.squeeze(0).cpu())
196
 
197
+ # Convert the audio tensor to a NumPy array before passing it to Gradio
198
+ generated_audio_numpy = generated_audio.numpy()
199
+
200
+ # Return the sample rate and the NumPy array containing the audio
201
+ return (sample_rate, generated_audio_numpy)
202
 
203
 
204
  # Gradio Interface