smjain commited on
Commit
7337797
1 Parent(s): cd2ecef

Upload infertest.py

Browse files
Files changed (1) hide show
  1. infertest.py +7 -1
infertest.py CHANGED
@@ -464,11 +464,17 @@ def cut_vocal_and_inst(audio_path,spk_id):
464
  #yield "\n".join(logs), None, None
465
  print("before executing splitter")
466
  command = f"demucs --two-stems=vocals -n {split_model} {audio_path} -o output"
467
- result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
 
 
 
 
 
468
  print("after executing splitter")
469
  #for line in result.stdout:
470
  # logs.append(line)
471
  # yield "\n".join(logs), None, None
 
472
  print(result.stdout)
473
  vocal = f"output/{split_model}/{spk_id}_input_audio/vocals.wav"
474
  inst = f"output/{split_model}/{spk_id}_input_audio/no_vocals.wav"
 
464
  #yield "\n".join(logs), None, None
465
  print("before executing splitter")
466
  command = f"demucs --two-stems=vocals -n {split_model} {audio_path} -o output"
467
+ #result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
468
+ result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
469
+ if result.returncode != 0:
470
+ print("Demucs process failed:", result.stderr)
471
+ else:
472
+ print("Demucs process completed successfully.")
473
  print("after executing splitter")
474
  #for line in result.stdout:
475
  # logs.append(line)
476
  # yield "\n".join(logs), None, None
477
+ result.wait()
478
  print(result.stdout)
479
  vocal = f"output/{split_model}/{spk_id}_input_audio/vocals.wav"
480
  inst = f"output/{split_model}/{spk_id}_input_audio/no_vocals.wav"