import gradio as gr from gradio_client import Client import os hf_token = os.environ.get('HF_TOKEN') splt_client = Client("https://fffiloni-splittrack2musicgen.hf.space/") #whisper_client = Client("https://sanchit-gandhi-whisper-jax.hf.space/") whisper_client = Client("https://fffiloni-whisper-large-v2.hf.space/", hf_token=hf_token) import re def format_lyrics(text): # Use regex to find parts that start with a capital letter and insert a newline formatted_text = re.sub(r'(?

Song To Lyrics

Send the audio file of your favorite song, and get the lyrics !
Under the hood, we split and get the vocals track from the audio file, then send the vocals to Whisper.

""") song_in = gr.Audio(label="Song input", type="filepath", source="upload") getlyrics_btn = gr.Button("Get Lyrics !") vocals_out = gr.Audio(label="Vocals Only") lyrics_res = gr.Textbox(label="Lyrics") getlyrics_btn.click(fn=infer, inputs=[song_in], outputs=[vocals_out, lyrics_res]) demo.queue().launch()