Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def classic(prompt, negative_prompt, duration):
|
|
35 |
wav = wav_bytes_from_spectrogram_image(spec)
|
36 |
with open("output.wav", "wb") as f:
|
37 |
f.write(wav[0].getbuffer())
|
38 |
-
return spec, 'output.wav'
|
39 |
|
40 |
def style_transfer(prompt, negative_prompt, audio_input):
|
41 |
spec = spectro_from_wav(audio_input)
|
@@ -52,7 +52,7 @@ def style_transfer(prompt, negative_prompt, audio_input):
|
|
52 |
wav = wav_bytes_from_spectrogram_image(new_spectro[0])
|
53 |
with open("output.wav", "wb") as f:
|
54 |
f.write(wav[0].getbuffer())
|
55 |
-
return new_spectro[0], 'output.wav'
|
56 |
|
57 |
def image_from_spectrogram(
|
58 |
spectrogram: np.ndarray, max_volume: float = 50, power_for_image: float = 0.25
|
@@ -228,7 +228,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
228 |
|
229 |
gr.HTML(article)
|
230 |
|
231 |
-
send_btn.click(predict, inputs=[prompt_input, negative_prompt, audio_input, duration_input], outputs=[spectrogram_output, sound_output
|
232 |
#share_button.click(None, [], [], _js=share_js)
|
233 |
|
234 |
demo.queue(max_size=250).launch(debug=True)
|
|
|
35 |
wav = wav_bytes_from_spectrogram_image(spec)
|
36 |
with open("output.wav", "wb") as f:
|
37 |
f.write(wav[0].getbuffer())
|
38 |
+
return spec, 'output.wav'
|
39 |
|
40 |
def style_transfer(prompt, negative_prompt, audio_input):
|
41 |
spec = spectro_from_wav(audio_input)
|
|
|
52 |
wav = wav_bytes_from_spectrogram_image(new_spectro[0])
|
53 |
with open("output.wav", "wb") as f:
|
54 |
f.write(wav[0].getbuffer())
|
55 |
+
return new_spectro[0], 'output.wav'
|
56 |
|
57 |
def image_from_spectrogram(
|
58 |
spectrogram: np.ndarray, max_volume: float = 50, power_for_image: float = 0.25
|
|
|
228 |
|
229 |
gr.HTML(article)
|
230 |
|
231 |
+
send_btn.click(predict, inputs=[prompt_input, negative_prompt, audio_input, duration_input], outputs=[spectrogram_output, sound_output])
|
232 |
#share_button.click(None, [], [], _js=share_js)
|
233 |
|
234 |
demo.queue(max_size=250).launch(debug=True)
|