Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from transformers.generation.streamers import BaseStreamer
|
|
11 |
import gradio as gr
|
12 |
import io, wave
|
13 |
|
14 |
-
|
15 |
|
16 |
|
17 |
from transformers import MusicgenMelodyForConditionalGeneration, MusicgenForConditionalGeneration, AutoProcessor, set_seed
|
@@ -607,7 +607,7 @@ def wave_header_chunk(frame_input=b"", channels=1, sample_width=2, sample_rate=2
|
|
607 |
|
608 |
return wav_buf.read()
|
609 |
|
610 |
-
|
611 |
def generate_audio(text_prompt, audio, audio_length_in_s=10.0, play_steps_in_s=2.0, seed=0):
|
612 |
max_new_tokens = int(frame_rate * audio_length_in_s)
|
613 |
play_steps = int(frame_rate * play_steps_in_s)
|
|
|
11 |
import gradio as gr
|
12 |
import io, wave
|
13 |
|
14 |
+
import spaces
|
15 |
|
16 |
|
17 |
from transformers import MusicgenMelodyForConditionalGeneration, MusicgenForConditionalGeneration, AutoProcessor, set_seed
|
|
|
607 |
|
608 |
return wav_buf.read()
|
609 |
|
610 |
+
@spaces.GPU()
|
611 |
def generate_audio(text_prompt, audio, audio_length_in_s=10.0, play_steps_in_s=2.0, seed=0):
|
612 |
max_new_tokens = int(frame_rate * audio_length_in_s)
|
613 |
play_steps = int(frame_rate * play_steps_in_s)
|