Spaces:
Runtime error
Runtime error
GPU version
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def inference(audio):
|
|
| 12 |
|
| 13 |
try:
|
| 14 |
# Using subprocess.run for better control
|
| 15 |
-
command = f"python3 -m demucs.separate -n htdemucs_6s -d
|
| 16 |
process = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 17 |
print("Demucs script output:", process.stdout.decode())
|
| 18 |
except subprocess.CalledProcessError as e:
|
|
@@ -21,7 +21,7 @@ def inference(audio):
|
|
| 21 |
|
| 22 |
try:
|
| 23 |
# Separating the stems using your custom separator
|
| 24 |
-
separator = Separator("./out/htdemucs_6s/test/vocals.wav", model_name='UVR_MDXNET_KARA_2', use_cuda=
|
| 25 |
primary_stem_path, secondary_stem_path = separator.separate()
|
| 26 |
except Exception as e:
|
| 27 |
print("Error in custom separation:", str(e))
|
|
|
|
| 12 |
|
| 13 |
try:
|
| 14 |
# Using subprocess.run for better control
|
| 15 |
+
command = f"python3 -m demucs.separate -n htdemucs_6s -d gpu {audio_path} -o out"
|
| 16 |
process = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 17 |
print("Demucs script output:", process.stdout.decode())
|
| 18 |
except subprocess.CalledProcessError as e:
|
|
|
|
| 21 |
|
| 22 |
try:
|
| 23 |
# Separating the stems using your custom separator
|
| 24 |
+
separator = Separator("./out/htdemucs_6s/test/vocals.wav", model_name='UVR_MDXNET_KARA_2', use_cuda=True, output_format='mp3')
|
| 25 |
primary_stem_path, secondary_stem_path = separator.separate()
|
| 26 |
except Exception as e:
|
| 27 |
print("Error in custom separation:", str(e))
|