Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,10 +62,12 @@ def process_track(audio_file, cover_art_image):
|
|
| 62 |
audio_file
|
| 63 |
], check=True, capture_output=True)
|
| 64 |
except subprocess.CalledProcessError as e:
|
|
|
|
| 65 |
raise RuntimeError(f"Demucs failed: {e.stderr.decode()}")
|
| 66 |
|
| 67 |
# Locate Stems (Robust Search)
|
| 68 |
demucs_out = TEMP_DIR / "htdemucs"
|
|
|
|
| 69 |
track_folder = next(demucs_out.iterdir(), None)
|
| 70 |
|
| 71 |
if not track_folder:
|
|
@@ -132,7 +134,7 @@ def process_track(audio_file, cover_art_image):
|
|
| 132 |
except Exception as e:
|
| 133 |
raise gr.Error(f"System Error: {str(e)}")
|
| 134 |
|
| 135 |
-
# --- UI Definition
|
| 136 |
iface = gr.Interface(
|
| 137 |
fn=process_track,
|
| 138 |
inputs=[
|
|
@@ -144,7 +146,7 @@ iface = gr.Interface(
|
|
| 144 |
gr.Video(label="Preview Video")
|
| 145 |
],
|
| 146 |
title="Night Pulse Audio | Automator",
|
| 147 |
-
description="Night Pulse Pipeline v1.
|
| 148 |
)
|
| 149 |
|
| 150 |
if __name__ == "__main__":
|
|
|
|
| 62 |
audio_file
|
| 63 |
], check=True, capture_output=True)
|
| 64 |
except subprocess.CalledProcessError as e:
|
| 65 |
+
# Catch and display the specific error from Demucs
|
| 66 |
raise RuntimeError(f"Demucs failed: {e.stderr.decode()}")
|
| 67 |
|
| 68 |
# Locate Stems (Robust Search)
|
| 69 |
demucs_out = TEMP_DIR / "htdemucs"
|
| 70 |
+
# Demucs might normalize filenames (spaces -> underscores), so we find the first folder
|
| 71 |
track_folder = next(demucs_out.iterdir(), None)
|
| 72 |
|
| 73 |
if not track_folder:
|
|
|
|
| 134 |
except Exception as e:
|
| 135 |
raise gr.Error(f"System Error: {str(e)}")
|
| 136 |
|
| 137 |
+
# --- UI Definition ---
|
| 138 |
iface = gr.Interface(
|
| 139 |
fn=process_track,
|
| 140 |
inputs=[
|
|
|
|
| 146 |
gr.Video(label="Preview Video")
|
| 147 |
],
|
| 148 |
title="Night Pulse Audio | Automator",
|
| 149 |
+
description="Night Pulse Pipeline v1.2 (Stable)"
|
| 150 |
)
|
| 151 |
|
| 152 |
if __name__ == "__main__":
|