nakas commited on
Commit
2cbbb84
·
1 Parent(s): 89e329e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -188,24 +188,22 @@ def inference(audio):
188
  os.makedirs("out", exist_ok=True)
189
  result = os.system(new_command)
190
  print(f"Demucs script result: {result}")
191
- common_dir = os.path.dirname(audio)
192
 
193
  files = [
194
- "./out/mdx_extra_q/test/vocals.wav",
195
- "./out/mdx_extra_q/test/bass.wav",
196
- "./out/mdx_extra_q/test/drums.wav",
197
- "./out/mdx_extra_q/test/other.wav"
198
  ]
199
 
200
- modified_files = [os.path.join(common_dir, os.path.basename(file)) for file in files]
201
-
202
- for file in modified_files:
203
  if not os.path.isfile(file):
204
  print(f"File not found: {file}")
205
  else:
206
  print(f"File exists: {file}")
207
 
208
- return modified_files
209
 
210
 
211
  def toggle_audio_src(choice):
 
188
  os.makedirs("out", exist_ok=True)
189
  result = os.system(new_command)
190
  print(f"Demucs script result: {result}")
191
+ directory_name = os.path.splitext(os.path.basename(audio))[0]
192
 
193
  files = [
194
+ f"./out/mdx_extra_q/{directory_name}/vocals.wav",
195
+ f"./out/mdx_extra_q/{directory_name}/bass.wav",
196
+ f"./out/mdx_extra_q/{directory_name}/drums.wav",
197
+ f"./out/mdx_extra_q/{directory_name}/other.wav"
198
  ]
199
 
200
+ for file in files:
 
 
201
  if not os.path.isfile(file):
202
  print(f"File not found: {file}")
203
  else:
204
  print(f"File exists: {file}")
205
 
206
+ return files
207
 
208
 
209
  def toggle_audio_src(choice):