File size: 907 Bytes
e4136ce
 
 
 
ac788b3
 
e4136ce
ac788b3
 
 
 
e4136ce
 
8ca22db
e4136ce
 
 
 
 
 
 
 
c31e738
6d2e591
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
import hopsworks
import subprocess
def vocal_remove(audio):    
    #project = hopsworks.login()
    #mr = project.get_model_registry()
    # model = mr.get_best_model("vocal_remover", "validation_loss", "min")
    #model = mr.get_model("vocal_remover", version=3)
    #model_path = model.download()
    #model_path_pth = model_path + "/vocal_model.pth"
    model_path_pth = "./baseline.pth"
    # print("model_path: ", model_path)s
    subprocess.run(["python3", "inference.py", "--input", audio, "--pretrained_model", model_path_pth, "--output_dir", "./"])
    return "./Instruments.mp3"

iface = gr.Interface(
    fn=vocal_remove, 
    inputs=gr.Audio(source="upload", type="filepath"), 
    outputs="audio",
    title="Vocal Remover",
    description="Removes Vocals from song, currently undertrained, fragments of vocals can remain depending on song",
)
iface.queue()
iface.launch()