Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,24 @@ def check_api(model_name):
|
|
11 |
return "api ready"
|
12 |
except :
|
13 |
return "api not ready yet"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
from moviepy.editor import VideoFileClip
|
16 |
from moviepy.audio.AudioClip import AudioClip
|
@@ -135,7 +153,7 @@ def get_mustango(prompt):
|
|
135 |
result = client.predict(
|
136 |
prompt, # str in 'Prompt' Textbox component
|
137 |
200, # float (numeric value between 100 and 200) in 'Steps' Slider component
|
138 |
-
|
139 |
api_name="/predict"
|
140 |
)
|
141 |
print(result)
|
@@ -248,7 +266,7 @@ with gr.Blocks(css=css) as demo:
|
|
248 |
],
|
249 |
value = "MAGNet"
|
250 |
)
|
251 |
-
check_status = gr.Textbox()
|
252 |
submit_btn = gr.Button("Make music from my pic !")
|
253 |
with gr.Column():
|
254 |
caption = gr.Textbox(
|
|
|
11 |
return "api ready"
|
12 |
except :
|
13 |
return "api not ready yet"
|
14 |
+
elif model_name == "AudioLDM-2":
|
15 |
+
try :
|
16 |
+
client = Client("https://haoheliu-audioldm2-text2audio-text2music.hf.space/")
|
17 |
+
return "api ready"
|
18 |
+
except :
|
19 |
+
return "api not ready yet"
|
20 |
+
elif model_name == "Riffusion":
|
21 |
+
try :
|
22 |
+
client = Client("https://fffiloni-spectrogram-to-music.hf.space/")
|
23 |
+
return "api ready"
|
24 |
+
except :
|
25 |
+
return "api not ready yet"
|
26 |
+
elif model_name == "Mustango":
|
27 |
+
try :
|
28 |
+
client = Client("https://declare-lab-mustango.hf.space/")
|
29 |
+
return "api ready"
|
30 |
+
except :
|
31 |
+
return "api not ready yet"
|
32 |
|
33 |
from moviepy.editor import VideoFileClip
|
34 |
from moviepy.audio.AudioClip import AudioClip
|
|
|
153 |
result = client.predict(
|
154 |
prompt, # str in 'Prompt' Textbox component
|
155 |
200, # float (numeric value between 100 and 200) in 'Steps' Slider component
|
156 |
+
6, # float (numeric value between 1 and 10) in 'Guidance Scale' Slider component
|
157 |
api_name="/predict"
|
158 |
)
|
159 |
print(result)
|
|
|
266 |
],
|
267 |
value = "MAGNet"
|
268 |
)
|
269 |
+
check_status = gr.Textbox(label="API status")
|
270 |
submit_btn = gr.Button("Make music from my pic !")
|
271 |
with gr.Column():
|
272 |
caption = gr.Textbox(
|