CCockrum commited on
Commit
3697795
·
verified ·
1 Parent(s): 895f03a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -3,22 +3,26 @@ import tempfile
3
  import subprocess
4
  import gradio as gr
5
  import logging
6
- import sys
7
  from pathlib import Path
 
8
 
9
  logging.basicConfig(level=logging.INFO)
10
  logger = logging.getLogger("demucs")
11
 
12
  DEFAULT_MODEL = "htdemucs"
13
 
 
 
14
 
15
  def run_demucs(audio_path, selected_stems, model_name=DEFAULT_MODEL):
16
  try:
17
  logger.info(f"Running Demucs on {audio_path}")
 
18
  output_dir = tempfile.mkdtemp()
19
 
20
  cmd = f"{sys.executable} -m demucs -n {model_name} -o {output_dir} \"{audio_path}\""
21
  logger.info(f"Executing command: {cmd}")
 
22
 
23
  process = subprocess.Popen(
24
  cmd,
@@ -29,6 +33,9 @@ def run_demucs(audio_path, selected_stems, model_name=DEFAULT_MODEL):
29
  )
30
 
31
  stdout, stderr = process.communicate()
 
 
 
32
 
33
  if process.returncode != 0:
34
  logger.error(f"Demucs error: {stderr}")
@@ -101,6 +108,7 @@ def create_interface():
101
 
102
 
103
  def main():
 
104
  interface = create_interface()
105
  interface.launch()
106
 
 
3
  import subprocess
4
  import gradio as gr
5
  import logging
 
6
  from pathlib import Path
7
+ import sys
8
 
9
  logging.basicConfig(level=logging.INFO)
10
  logger = logging.getLogger("demucs")
11
 
12
  DEFAULT_MODEL = "htdemucs"
13
 
14
+ print("✅ App is starting...")
15
+ print(f"✅ Using Python at {sys.executable}")
16
 
17
  def run_demucs(audio_path, selected_stems, model_name=DEFAULT_MODEL):
18
  try:
19
  logger.info(f"Running Demucs on {audio_path}")
20
+ print("🔄 Starting demucs process...")
21
  output_dir = tempfile.mkdtemp()
22
 
23
  cmd = f"{sys.executable} -m demucs -n {model_name} -o {output_dir} \"{audio_path}\""
24
  logger.info(f"Executing command: {cmd}")
25
+ print(f"🧪 Running command: {cmd}")
26
 
27
  process = subprocess.Popen(
28
  cmd,
 
33
  )
34
 
35
  stdout, stderr = process.communicate()
36
+ print("✅ Process finished.")
37
+ print("STDOUT:\n", stdout)
38
+ print("STDERR:\n", stderr)
39
 
40
  if process.returncode != 0:
41
  logger.error(f"Demucs error: {stderr}")
 
108
 
109
 
110
  def main():
111
+ print("🚀 Launching Gradio interface...")
112
  interface = create_interface()
113
  interface.launch()
114