TheStinger commited on
Commit
36af447
1 Parent(s): 085da01

test for the progress bar

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -2,15 +2,18 @@ import os
2
  import gradio as gr
3
  from scipy.io.wavfile import write
4
 
5
-
6
- def inference(audio):
7
- os.makedirs("out", exist_ok=True)
8
- write('test.wav', audio[0], audio[1])
9
- os.system("python3 -m demucs.separate -n htdemucs --two-stems=vocals -d cpu test.wav -o out")
10
- return "./out/htdemucs/test/vocals.wav","./out/htdemucs/test/no_vocals.wav"
 
 
 
11
 
12
  title = "Ilaria UVR 💖"
13
- description = "Drag and drop an audio file to easily separate it! [Join AI Hub Discord Server](https://discord.gg/aihub).</p>"
14
  article = "Made with 💖 by Ilaria"
15
 
16
  examples=[['test.mp3']]
@@ -22,4 +25,4 @@ gr.Interface(
22
  description=description,
23
  article=article,
24
  examples=examples
25
- ).launch(enable_queue=True)
 
2
  import gradio as gr
3
  from scipy.io.wavfile import write
4
 
5
+ def inference(audio, progress=gr.Progress()):
6
+ progress(0, "Inizio...")
7
+ os.makedirs("out", exist_ok=True)
8
+ write('test.wav', audio[0], audio[1])
9
+ progress(33, "Separazione in corso...")
10
+ os.system("python3 -m demucs.separate -n htdemucs --two-stems=vocals -d cpu test.wav -o out")
11
+ progress(66, "Separazione completata...")
12
+ progress(100, "Finito!")
13
+ return "./out/htdemucs/test/vocals.wav","./out/htdemucs/test/no_vocals.wav"
14
 
15
  title = "Ilaria UVR 💖"
16
+ description = "Drag and drop an audio file to easily separate it! Join AI Hub Discord Server.</p>"
17
  article = "Made with 💖 by Ilaria"
18
 
19
  examples=[['test.mp3']]
 
25
  description=description,
26
  article=article,
27
  examples=examples
28
+ ).launch()