owiedotch commited on
Commit
35b2678
1 Parent(s): eb814f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -51,7 +51,9 @@ def inference(audio_file, model_name, vocals, drums, bass, other, mp3, mp3_bitra
51
  cmd += f" --filename \"{audio_file}\""
52
 
53
  # Run Demucs
 
54
  demucs.separate.main(shlex.split(cmd))
 
55
 
56
  # Get the output file paths
57
  output_dir = os.path.join("separated", model_name, os.path.splitext(os.path.basename(audio_file))[0])
 
51
  cmd += f" --filename \"{audio_file}\""
52
 
53
  # Run Demucs
54
+ os.chdir(os.path.dirname(audio_file)) # Change working directory
55
  demucs.separate.main(shlex.split(cmd))
56
+ os.chdir(os.path.dirname(__file__)) # Change back to original directory
57
 
58
  # Get the output file paths
59
  output_dir = os.path.join("separated", model_name, os.path.splitext(os.path.basename(audio_file))[0])