fffiloni commited on
Commit
9edd470
·
1 Parent(s): f708112

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,8 +1,12 @@
1
  import gradio as gr
2
  from gradio_client import Client
3
 
 
 
 
4
  def infer(audio_input):
5
- splt_client = Client("https://fffiloni-splittrack2musicgen.hf.space/")
 
6
  splt_result = splt_client.predict(
7
  audio_input, # str (filepath or URL to file) in 'Input' Audio component
8
  "vocals", # str in 'Track' Radio component
@@ -10,9 +14,7 @@ def infer(audio_input):
10
  )
11
  print(splt_result)
12
 
13
-
14
-
15
- whisper_client = Client("https://sanchit-gandhi-whisper-jax.hf.space/")
16
  whisper_result = whisper_client.predict(
17
  split_result, # str (filepath or URL to file) in 'inputs' Audio component
18
  "transcribe", # str in 'Task' Radio component
@@ -23,6 +25,10 @@ def infer(audio_input):
23
 
24
  return "Done"
25
 
 
 
 
 
26
  with gr.Blocks(css=css) as demo:
27
  with gr.Column(col-container):
28
  song_in = gr.Audio(label="Song input", type="filepath", source="upload")
 
1
  import gradio as gr
2
  from gradio_client import Client
3
 
4
+ splt_client = Client("https://fffiloni-splittrack2musicgen.hf.space/")
5
+ whisper_client = Client("https://sanchit-gandhi-whisper-jax.hf.space/")
6
+
7
  def infer(audio_input):
8
+
9
+ # STEP 1 | Split vocals from the song/audio file
10
  splt_result = splt_client.predict(
11
  audio_input, # str (filepath or URL to file) in 'Input' Audio component
12
  "vocals", # str in 'Track' Radio component
 
14
  )
15
  print(splt_result)
16
 
17
+ # STEP 2 | Transcribe
 
 
18
  whisper_result = whisper_client.predict(
19
  split_result, # str (filepath or URL to file) in 'inputs' Audio component
20
  "transcribe", # str in 'Task' Radio component
 
25
 
26
  return "Done"
27
 
28
+ css = """
29
+ #col-container {max-width: 510px; margin-left: auto; margin-right: auto;}
30
+ """
31
+
32
  with gr.Blocks(css=css) as demo:
33
  with gr.Column(col-container):
34
  song_in = gr.Audio(label="Song input", type="filepath", source="upload")