fffiloni commited on
Commit
1c32bc8
1 Parent(s): 976c666

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -120,6 +120,17 @@ def get_riffusion(prompt):
120
  )
121
  print(result)
122
  return result[1]
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  import re
125
  import torch
@@ -171,6 +182,9 @@ def infer(image_in, chosen_model):
171
  elif chosen_model == "Riffusion" :
172
  gr.Info("Now calling Riffusion for music...")
173
  music_o = get_riffusion(musical_prompt)
 
 
 
174
 
175
  return musical_prompt, music_o
176
 
@@ -204,7 +218,8 @@ with gr.Blocks(css=css) as demo:
204
  choices = [
205
  "MAGNet",
206
  "AudioLDM-2",
207
- "Riffusion"
 
208
  ],
209
  value = "MAGNet"
210
  )
 
120
  )
121
  print(result)
122
  return result[1]
123
+
124
+ def get_mustango(prompt):
125
+ client = Client("https://declare-lab-mustango.hf.space/")
126
+ result = client.predict(
127
+ "Hello!!", # str in 'Prompt' Textbox component
128
+ 100, # float (numeric value between 100 and 200) in 'Steps' Slider component
129
+ 1, # float (numeric value between 1 and 10) in 'Guidance Scale' Slider component
130
+ api_name="/predict"
131
+ )
132
+ print(result)
133
+ return result
134
 
135
  import re
136
  import torch
 
182
  elif chosen_model == "Riffusion" :
183
  gr.Info("Now calling Riffusion for music...")
184
  music_o = get_riffusion(musical_prompt)
185
+ elif chosen_model == "Mustango" :
186
+ gr.Info("Now calling Mustango for music...")
187
+ music_o = get_mustango(musical_prompt)
188
 
189
  return musical_prompt, music_o
190
 
 
218
  choices = [
219
  "MAGNet",
220
  "AudioLDM-2",
221
+ "Riffusion",
222
+ "Mustango"
223
  ],
224
  value = "MAGNet"
225
  )