CleanSong commited on
Commit
a28f201
·
verified ·
1 Parent(s): b51f322

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
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
- try:
15
- client = Client(BACKEND_SPACE)
16
- result = client.predict(
17
- file_path,
18
- api_name="/predict"
19
- )
20
- except Exception as e:
21
- return f"Error calling backend: {e}"
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
  # ------------------------------------------------------------