deepsync commited on
Commit
f21457c
·
verified ·
1 Parent(s): cfc96d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -2,7 +2,7 @@ import time
2
  from pathlib import Path
3
 
4
  import gradio as gr
5
- import onnxruntime as rt
6
  from audio_separator.separator import Separator
7
  from pydub import AudioSegment
8
  from pytube import YouTube
@@ -54,20 +54,21 @@ def audio_sep(youtube_url, audio_path, separation_model, separation_mode, progre
54
  separation_mode = None
55
  progress(0, desc="Starting...")
56
  separator = Separator(
57
- audio_path,
58
- model_name=separation_model,
59
- use_cuda=True if rt.get_device() == "GPU" else False,
60
  output_dir=str(out_folder),
61
  output_single_stem=separation_mode,
62
  )
63
- for i in progress.tqdm(range(50)):
64
- time.sleep(0.01)
 
65
 
66
- results = [out_folder / p for p in separator.separate()]
67
  print(results)
68
 
69
- for i in progress.tqdm(range(50, 100)):
70
- time.sleep(0.01)
71
 
72
  if separation_mode == "Instrument":
73
  instrument_stem_path = str(results[0])
 
2
  from pathlib import Path
3
 
4
  import gradio as gr
5
+ # import onnxruntime as rt
6
  from audio_separator.separator import Separator
7
  from pydub import AudioSegment
8
  from pytube import YouTube
 
54
  separation_mode = None
55
  progress(0, desc="Starting...")
56
  separator = Separator(
57
+ # audio_path,
58
+ # model_name=separation_model,
59
+ # use_cuda=True if rt.get_device() == "GPU" else False
60
  output_dir=str(out_folder),
61
  output_single_stem=separation_mode,
62
  )
63
+ separator.load_model(separation_model)
64
+ # for i in progress.tqdm(range(50)):
65
+ # time.sleep(0.01)
66
 
67
+ results = [out_folder / p for p in separator.separate(audio_path)]
68
  print(results)
69
 
70
+ # for i in progress.tqdm(range(50, 100)):
71
+ # time.sleep(0.01)
72
 
73
  if separation_mode == "Instrument":
74
  instrument_stem_path = str(results[0])