multimodalart HF staff commited on
Commit
908925b
Β·
1 Parent(s): eb88bf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -28,6 +28,8 @@ audioldm = build_model()
28
  # return response, history
29
 
30
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
 
 
31
  # print(text, length, guidance_scale)
32
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
33
  waveform = [gr.make_waveform((16000, wave[0]), bg_image="bg.png") for wave in waveform]
 
28
  # return response, history
29
 
30
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
31
+ if(is_shared_ui):
32
+ raise gr.Error("This Space doesn't work on this shared UI. Duplicate and associate a GPU to it")
33
  # print(text, length, guidance_scale)
34
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
35
  waveform = [gr.make_waveform((16000, wave[0]), bg_image="bg.png") for wave in waveform]