Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,24 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
from gradio_client import Client
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
# IMPORTANT: token must be set as env var
|
| 6 |
-
# os.environ["HF_TOKEN"] = "hf_xxx" # only if not already set
|
| 7 |
-
|
| 8 |
BACKEND_SPACE = "CleanSong-AI/Main-tool-backend-main"
|
| 9 |
|
| 10 |
def clean_song(file_path):
|
| 11 |
if file_path is None:
|
| 12 |
return None
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
return result
|
| 24 |
|
|
|
|
| 25 |
# ------------------------------------------------------------
|
| 26 |
# UI
|
| 27 |
# ------------------------------------------------------------
|
|
|
|
|
|
|
| 1 |
from gradio_client import Client
|
| 2 |
import os
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
BACKEND_SPACE = "CleanSong-AI/Main-tool-backend-main"
|
| 5 |
|
| 6 |
def clean_song(file_path):
|
| 7 |
if file_path is None:
|
| 8 |
return None
|
| 9 |
|
| 10 |
+
client = Client(BACKEND_SPACE)
|
| 11 |
+
|
| 12 |
+
result = client.predict(
|
| 13 |
+
file_path,
|
| 14 |
+
api_name="/predict"
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
print("RAW RESULT FROM BACKEND:", repr(result), type(result))
|
| 18 |
|
| 19 |
return result
|
| 20 |
|
| 21 |
+
|
| 22 |
# ------------------------------------------------------------
|
| 23 |
# UI
|
| 24 |
# ------------------------------------------------------------
|