Commit
·
4f5f255
1
Parent(s):
9847153
Update app.py
Browse files
app.py
CHANGED
@@ -25,13 +25,12 @@ def predict(text):
|
|
25 |
|
26 |
with torch.autocast("cuda"):
|
27 |
outputs = model.generate(**inputs, do_sample=True, guidance_scale=3, max_new_tokens=512)
|
28 |
-
data = outputs[0].cpu().numpy().astype(np.float16)
|
29 |
|
30 |
-
video_path = gr.make_waveform((32000,
|
31 |
command = f'ffmpeg -y -i {video_path} -vf "scale=250:150" result.mp4'
|
32 |
subprocess.run(command, shell=True)
|
33 |
|
34 |
-
return (32000,
|
35 |
|
36 |
title = "MusicGen"
|
37 |
|
|
|
25 |
|
26 |
with torch.autocast("cuda"):
|
27 |
outputs = model.generate(**inputs, do_sample=True, guidance_scale=3, max_new_tokens=512)
|
|
|
28 |
|
29 |
+
video_path = gr.make_waveform((32000, outputs[0].cpu().numpy().astype(np.float16).ravel()), bars_color=random.choice(COLORS), bar_count=75)
|
30 |
command = f'ffmpeg -y -i {video_path} -vf "scale=250:150" result.mp4'
|
31 |
subprocess.run(command, shell=True)
|
32 |
|
33 |
+
return (32000, outputs[0][0].cpu().numpy().astype(np.float16)), "result.mp4"
|
34 |
|
35 |
title = "MusicGen"
|
36 |
|