owiedotch commited on
Commit
f523848
·
verified ·
1 Parent(s): f0099f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -23,7 +23,7 @@ def inference(audio_file: str, model_name: str, vocals: bool, drums: bool, bass:
23
  yield None, stream_log(f"Loading audio file: {audio_file}")
24
 
25
  # Load the audio file with the correct samplerate
26
- wav = load_track(audio_file, separator.samplerate)
27
 
28
  # Check the number of channels and adjust if necessary
29
  if wav.shape[0] == 1:
@@ -34,7 +34,7 @@ def inference(audio_file: str, model_name: str, vocals: bool, drums: bool, bass:
34
  ref = wav.mean(0)
35
  wav = (wav - ref.view(1, -1)).to(device)
36
  yield None, stream_log("Audio loaded successfully. Applying model...")
37
- sources = apply_model(separator, wav, device=device, progress=True)
38
  sources = sources * ref.view(1, -1) + ref.view(1, -1)
39
  yield None, stream_log("Model applied. Processing stems...")
40
 
 
23
  yield None, stream_log(f"Loading audio file: {audio_file}")
24
 
25
  # Load the audio file with the correct samplerate
26
+ wav, sr = load_track(audio_file)
27
 
28
  # Check the number of channels and adjust if necessary
29
  if wav.shape[0] == 1:
 
34
  ref = wav.mean(0)
35
  wav = (wav - ref.view(1, -1)).to(device)
36
  yield None, stream_log("Audio loaded successfully. Applying model...")
37
+ sources = apply_model(separator, wav, device=device, progress=True, samplerate=sr)
38
  sources = sources * ref.view(1, -1) + ref.view(1, -1)
39
  yield None, stream_log("Model applied. Processing stems...")
40