Spaces:
Running
Running
Update musicgen_app.py
Browse files- musicgen_app.py +4 -1
musicgen_app.py
CHANGED
@@ -108,11 +108,14 @@ def load_diffusion():
|
|
108 |
MBD = MultiBandDiffusion.get_mbd_musicgen()
|
109 |
|
110 |
|
|
|
|
|
111 |
def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
112 |
print("texts[0]:"+texts[0])
|
113 |
print("texts[1]:"+texts[1])
|
114 |
newTexts = []
|
115 |
-
newTexts.append(generatePrompt(texts[0],texts[1]))
|
|
|
116 |
newDuration = generateTime(texts[0], duration)
|
117 |
MODEL.set_generation_params(duration=duration, **gen_kwargs)
|
118 |
print("new batch", len(newTexts), newTexts[0], [None if m is None else (m[0], m[1].shape) for m in melodies])
|
|
|
108 |
MBD = MultiBandDiffusion.get_mbd_musicgen()
|
109 |
|
110 |
|
111 |
+
|
112 |
+
testText = "Compose a solo piano piece in the style of Ludwig Van Beethoven, capturing feelings of intense sadness and surprise. Convey disappointment, love, and a touch of grief through the music, as per the primary sentiments detected. The predominant emotion of sadness could be represented through a slow tempo and minor key. Use a time signature of 3/4, rhythms that are flowing yet melancholic, and dynamics ranging from pianissimo to mezzo forte to reflect fluctuations of surprise and disappointment. Develop a poignant and haunting melodic line that unfolds slowly, adding layers of complexity as secondary emotions such as love and grief are woven into the piece. Achieve a distinct Beethoven-esque character through heavy use of the lower and upper registers of the piano, a notable expressive intensity, and contrast between the melancholic melody and more hopeful moments. Use sudden changes in dynamics to describe the element of surprise. The piece should be complete with a clear start and end."
|
113 |
def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
114 |
print("texts[0]:"+texts[0])
|
115 |
print("texts[1]:"+texts[1])
|
116 |
newTexts = []
|
117 |
+
#newTexts.append(generatePrompt(texts[0],texts[1]))
|
118 |
+
newTexts.append(testText)
|
119 |
newDuration = generateTime(texts[0], duration)
|
120 |
MODEL.set_generation_params(duration=duration, **gen_kwargs)
|
121 |
print("new batch", len(newTexts), newTexts[0], [None if m is None else (m[0], m[1].shape) for m in melodies])
|