Spaces:
Runtime error
Runtime error
update apps to incude latent diffusion
Browse files- app.py +23 -21
- streamlit_app.py +9 -6
app.py
CHANGED
@@ -15,28 +15,30 @@ def generate_spectrogram_audio_and_loop(model_id):
|
|
15 |
return image, (sample_rate, audio), (sample_rate, loop)
|
16 |
|
17 |
|
18 |
-
demo = gr.Interface(
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
],
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
|
41 |
if __name__ == "__main__":
|
42 |
parser = argparse.ArgumentParser()
|
|
|
15 |
return image, (sample_rate, audio), (sample_rate, loop)
|
16 |
|
17 |
|
18 |
+
demo = gr.Interface(
|
19 |
+
fn=generate_spectrogram_audio_and_loop,
|
20 |
+
title="Audio Diffusion",
|
21 |
+
description="Generate audio using Huggingface diffusers.\
|
22 |
+
The models without 'latent' or 'ddim' give better results but take about \
|
23 |
+
20 minutes without a GPU.",
|
24 |
+
inputs=[
|
25 |
+
gr.Dropdown(label="Model",
|
26 |
+
choices=[
|
27 |
+
"teticio/audio-diffusion-256",
|
28 |
+
"teticio/audio-diffusion-breaks-256",
|
29 |
+
"teticio/audio-diffusion-instrumental-hiphop-256",
|
30 |
+
"teticio/audio-diffusion-ddim-256",
|
31 |
+
"teticio/latent-audio-diffusion-256",
|
32 |
+
"teticio/latent-audio-diffusion-ddim-256"
|
33 |
],
|
34 |
+
value="teticio/latent-audio-diffusion-ddim-256")
|
35 |
+
],
|
36 |
+
outputs=[
|
37 |
+
gr.Image(label="Mel spectrogram", image_mode="L"),
|
38 |
+
gr.Audio(label="Audio"),
|
39 |
+
gr.Audio(label="Loop"),
|
40 |
+
],
|
41 |
+
allow_flagging="never")
|
42 |
|
43 |
if __name__ == "__main__":
|
44 |
parser = argparse.ArgumentParser()
|
streamlit_app.py
CHANGED
@@ -8,16 +8,19 @@ from audiodiffusion import AudioDiffusion
|
|
8 |
|
9 |
if __name__ == "__main__":
|
10 |
st.header("Audio Diffusion")
|
11 |
-
st.markdown(
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
model_id = st.selectbox("Model", [
|
17 |
"teticio/audio-diffusion-256", "teticio/audio-diffusion-breaks-256",
|
18 |
"teticio/audio-diffusion-instrumental-hiphop-256",
|
19 |
-
"teticio/audio-diffusion-ddim-256"
|
20 |
-
|
|
|
|
|
|
|
21 |
audio_diffusion = AudioDiffusion(model_id=model_id)
|
22 |
|
23 |
if st.button("Generate"):
|
|
|
8 |
|
9 |
if __name__ == "__main__":
|
10 |
st.header("Audio Diffusion")
|
11 |
+
st.markdown(
|
12 |
+
"Generate audio using Huggingface diffusers.\
|
13 |
+
The models without 'latent' or 'ddim' give better results but take about \
|
14 |
+
20 minutes without a GPU.", )
|
15 |
|
16 |
model_id = st.selectbox("Model", [
|
17 |
"teticio/audio-diffusion-256", "teticio/audio-diffusion-breaks-256",
|
18 |
"teticio/audio-diffusion-instrumental-hiphop-256",
|
19 |
+
"teticio/audio-diffusion-ddim-256",
|
20 |
+
"teticio/latent-audio-diffusion-256",
|
21 |
+
"teticio/latent-audio-diffusion-ddim-256"
|
22 |
+
],
|
23 |
+
index=5)
|
24 |
audio_diffusion = AudioDiffusion(model_id=model_id)
|
25 |
|
26 |
if st.button("Generate"):
|