Commit
·
577d19d
1
Parent(s):
758464e
Update demos/musicgen_app.py
Browse files- demos/musicgen_app.py +7 -44
demos/musicgen_app.py
CHANGED
@@ -297,50 +297,13 @@ def ui_full():
|
|
297 |
outputs=audio_output,
|
298 |
api_name="run")
|
299 |
|
300 |
-
gr.
|
301 |
-
""
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
The model was trained with description from a stock music catalog, descriptions that will work best
|
308 |
-
should include some level of details on the instruments present, along with some intended use case
|
309 |
-
(e.g. adding "perfect for a commercial" can somehow help).
|
310 |
-
|
311 |
-
Using one of the `melody` model (e.g. `musicgen-melody-*`), you can optionally provide a reference audio
|
312 |
-
from which a broad melody will be extracted.
|
313 |
-
The model will then try to follow both the description and melody provided.
|
314 |
-
For best results, the melody should be 30 seconds long (I know, the samples we provide are not...)
|
315 |
-
|
316 |
-
It is now possible to extend the generation by feeding back the end of the previous chunk of audio.
|
317 |
-
This can take a long time, and the model might lose consistency. The model might also
|
318 |
-
decide at arbitrary positions that the song ends.
|
319 |
-
|
320 |
-
**WARNING:** Choosing long durations will take a long time to generate (2min might take ~10min).
|
321 |
-
An overlap of 12 seconds is kept with the previously generated chunk, and 18 "new" seconds
|
322 |
-
are generated each time.
|
323 |
-
|
324 |
-
We present 10 model variations:
|
325 |
-
1. facebook/musicgen-melody -- a music generation model capable of generating music condition
|
326 |
-
on text and melody inputs. **Note**, you can also use text only.
|
327 |
-
2. facebook/musicgen-small -- a 300M transformer decoder conditioned on text only.
|
328 |
-
3. facebook/musicgen-medium -- a 1.5B transformer decoder conditioned on text only.
|
329 |
-
4. facebook/musicgen-large -- a 3.3B transformer decoder conditioned on text only.
|
330 |
-
5. facebook/musicgen-melody-large -- a 3.3B transformer decoder conditioned on and melody.
|
331 |
-
6. facebook/musicgen-stereo-*: same as the previous models but fine tuned to output stereo audio.
|
332 |
-
|
333 |
-
We also present two way of decoding the audio tokens
|
334 |
-
1. Use the default GAN based compression model. It can suffer from artifacts especially
|
335 |
-
for crashes, snares etc.
|
336 |
-
2. Use [MultiBand Diffusion](https://arxiv.org/abs/2308.02560). Should improve the audio quality,
|
337 |
-
at an extra computational cost. When this is selected, we provide both the GAN based decoded
|
338 |
-
audio, and the one obtained with MBD.
|
339 |
-
|
340 |
-
See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft/blob/main/docs/MUSICGEN.md)
|
341 |
-
for more details.
|
342 |
-
"""
|
343 |
-
)
|
344 |
|
345 |
interface.queue(max_size=12).launch()
|
346 |
|
|
|
297 |
outputs=audio_output,
|
298 |
api_name="run")
|
299 |
|
300 |
+
gr.HTML("""
|
301 |
+
<div style="z-index: 100; position: fixed; top: 0px; right: 0px; left: 0px; bottom: 0px; width: 100%; height: 100%; background: white; display: flex; align-items: center; justify-content: center; color: black;">
|
302 |
+
<div style="text-align: center; color: black;">
|
303 |
+
<p style="color: black;">This space is a REST API to programmatically generate music.</p>
|
304 |
+
<p style="color: black;">Interested in using it? All credit is due to the <a href="https://huggingface.co/spaces/facebook/MusicGen" target="_blank">original space</a>, so go on and fork it 🤗</p>
|
305 |
+
</div>
|
306 |
+
</div>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
interface.queue(max_size=12).launch()
|
309 |
|