Spaces:
Sleeping
Sleeping
Commit
·
b39c073
1
Parent(s):
0f6ba49
cmon claude no handle_file
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=handle_file(audio_path)
|
| 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
|
| 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 - pass file path directly
|
| 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=audio_path, # Pass file path directly instead of handle_file(audio_path)
|
| 263 |
api_name="/predict"
|
| 264 |
)
|
| 265 |
|