owiedotch commited on
Commit
85fcc07
1 Parent(s): 0ff04fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -63,8 +63,14 @@ def inference(audio_file: str, model_name: str, vocals: bool, drums: bool, bass:
63
  stems[stem] = stem_path
64
  yield None, stream_log(f"Found {stem} stem")
65
 
66
- selected_stems: List[str] = [stems[stem] for stem in stems if locals()[stem]]
 
 
 
 
 
67
  if not selected_stems:
 
68
  raise gr.Error("Please select at least one stem to mix.")
69
 
70
  output_file: str = os.path.join(output_dir, "mixed.wav")
 
63
  stems[stem] = stem_path
64
  yield None, stream_log(f"Found {stem} stem")
65
 
66
+ selected_stems: List[str] = []
67
+ for stem, selected in zip(["vocals", "drums", "bass", "other"], [vocals, drums, bass, other]):
68
+ if selected and stem in stems:
69
+ selected_stems.append(stems[stem])
70
+ yield None, stream_log(f"Selected {stem} stem for mixing")
71
+
72
  if not selected_stems:
73
+ yield None, stream_log("Error: No stems selected for mixing")
74
  raise gr.Error("Please select at least one stem to mix.")
75
 
76
  output_file: str = os.path.join(output_dir, "mixed.wav")