Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
108943b
1
Parent(s):
92a1521
handle_file added back in
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from einops import rearrange
|
|
16 |
from huggingface_hub import login
|
17 |
from stable_audio_tools import get_pretrained_model
|
18 |
from stable_audio_tools.inference.generation import generate_diffusion_cond
|
19 |
-
from gradio_client import Client
|
20 |
from contextlib import contextmanager
|
21 |
|
22 |
# Global model storage
|
@@ -249,7 +249,7 @@ def transform_with_melodyflow_api(audio_path, prompt, solver="euler", flowstep=0
|
|
249 |
print(f" Solver: {solver} ({effective_steps} effective steps)")
|
250 |
print(f" Flowstep: {flowstep}")
|
251 |
|
252 |
-
# Call the MelodyFlow API
|
253 |
result = client.predict(
|
254 |
model="facebook/melodyflow-t24-30secs",
|
255 |
text=prompt,
|
@@ -259,7 +259,7 @@ def transform_with_melodyflow_api(audio_path, prompt, solver="euler", flowstep=0
|
|
259 |
regularize=solver == "euler",
|
260 |
regularization_strength=0.2,
|
261 |
duration=30,
|
262 |
-
melody=
|
263 |
api_name="/predict"
|
264 |
)
|
265 |
|
|
|
16 |
from huggingface_hub import login
|
17 |
from stable_audio_tools import get_pretrained_model
|
18 |
from stable_audio_tools.inference.generation import generate_diffusion_cond
|
19 |
+
from gradio_client import Client, handle_file
|
20 |
from contextlib import contextmanager
|
21 |
|
22 |
# Global model storage
|
|
|
249 |
print(f" Solver: {solver} ({effective_steps} effective steps)")
|
250 |
print(f" Flowstep: {flowstep}")
|
251 |
|
252 |
+
# Call the MelodyFlow API
|
253 |
result = client.predict(
|
254 |
model="facebook/melodyflow-t24-30secs",
|
255 |
text=prompt,
|
|
|
259 |
regularize=solver == "euler",
|
260 |
regularization_strength=0.2,
|
261 |
duration=30,
|
262 |
+
melody=handle_file(audio_path),
|
263 |
api_name="/predict"
|
264 |
)
|
265 |
|