Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
from queue import Queue
|
2 |
from threading import Thread
|
3 |
from typing import Optional
|
@@ -11,7 +13,7 @@ import spaces
|
|
11 |
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
|
12 |
processor = MusicgenProcessor.from_pretrained("facebook/musicgen-small")
|
13 |
|
14 |
-
title = "
|
15 |
|
16 |
class MusicgenStreamer(BaseStreamer):
|
17 |
def __init__(self, model, device=None, play_steps=10, stride=None, timeout=None):
|
@@ -83,9 +85,6 @@ demo = gr.Interface(
|
|
83 |
gr.Slider(0, 10, value=5, step=1, label="Seed for random generations"),
|
84 |
],
|
85 |
outputs=[gr.Audio(label="Generated Music", streaming=True, autoplay=True)],
|
86 |
-
examples=[
|
87 |
-
["lofi slow bpm electro chill with organic samples", 30, 1.5, 5],
|
88 |
-
],
|
89 |
title=title,
|
90 |
cache_examples=False,
|
91 |
)
|
|
|
1 |
+
# This code is based on Sanchit Gandhi's MusicGen-Streaming: https://huggingface.co/spaces/sanchit-gandhi/musicgen-streaming
|
2 |
+
|
3 |
from queue import Queue
|
4 |
from threading import Thread
|
5 |
from typing import Optional
|
|
|
13 |
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
|
14 |
processor = MusicgenProcessor.from_pretrained("facebook/musicgen-small")
|
15 |
|
16 |
+
title = "AI Radio"
|
17 |
|
18 |
class MusicgenStreamer(BaseStreamer):
|
19 |
def __init__(self, model, device=None, play_steps=10, stride=None, timeout=None):
|
|
|
85 |
gr.Slider(0, 10, value=5, step=1, label="Seed for random generations"),
|
86 |
],
|
87 |
outputs=[gr.Audio(label="Generated Music", streaming=True, autoplay=True)],
|
|
|
|
|
|
|
88 |
title=title,
|
89 |
cache_examples=False,
|
90 |
)
|