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

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -0
app.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
9
+ api_name="/splt_trck"
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
19
+ True, # bool in 'Return timestamps' Checkbox component
20
+ api_name="/predict"
21
+ )
22
+ print(whisper_result)
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")
29
+ getlyrics_btn = gr.Button("Get Lyrics !")
30
+ lyrics_res = gr.Textbox(label="Lyrics")
31
+
32
+ getlyrics_btn.click(fn=infer, inputs=[song_in], outputs=[lyrics_res])
33
+
34
+ demo.queue().launch()
35
+