Propose Zero GPU

#78
by ylacombe HF staff - opened
Files changed (1) hide show
  1. demos/musicgen_app.py +2 -0
demos/musicgen_app.py CHANGED
@@ -22,6 +22,7 @@ import warnings
22
  from einops import rearrange
23
  import torch
24
  import gradio as gr
 
25
 
26
  from audiocraft.data.audio_utils import convert_audio
27
  from audiocraft.data.audio import audio_write
@@ -170,6 +171,7 @@ def _do_predictions(texts, melodies, duration, progress=False, gradio_progress=N
170
  return out_videos, out_wavs
171
 
172
 
 
173
  def predict_batched(texts, melodies):
174
  max_text_length = 512
175
  texts = [text[:max_text_length] for text in texts]
 
22
  from einops import rearrange
23
  import torch
24
  import gradio as gr
25
+ import spaces
26
 
27
  from audiocraft.data.audio_utils import convert_audio
28
  from audiocraft.data.audio import audio_write
 
171
  return out_videos, out_wavs
172
 
173
 
174
+ @spaces.GPU
175
  def predict_batched(texts, melodies):
176
  max_text_length = 512
177
  texts = [text[:max_text_length] for text in texts]