pranavinani commited on
Commit
0c8b986
·
verified ·
1 Parent(s): c354f04

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. media_ingestion.py +17 -1
  2. poster.tex +0 -0
media_ingestion.py CHANGED
@@ -78,7 +78,23 @@ class MediaIngester:
78
  ]
79
 
80
  print(f"Separating audio sources from {os.path.basename(audio_path)}...")
81
- result = subprocess.run(cmd, check=True, capture_output=True, text=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  print("Separation complete.")
83
 
84
  # Demucs creates a subdirectory with model name and then the base name
 
78
  ]
79
 
80
  print(f"Separating audio sources from {os.path.basename(audio_path)}...")
81
+ try:
82
+ process = subprocess.run(
83
+ cmd,
84
+ capture_output=True,
85
+ text=False, # Capture as bytes first
86
+ check=True # Or handle non-zero exit codes manually
87
+ )
88
+ stdout_str = process.stdout.decode('utf-8', errors='replace')
89
+ stderr_str = process.stderr.decode('utf-8', errors='replace')
90
+ # Now work with stdout_str and stderr_str
91
+ except subprocess.CalledProcessError as e:
92
+ stderr_str = e.stderr.decode('utf-8', errors='replace') if e.stderr else ""
93
+ logger.error(f"Demucs CLI failed: {stderr_str}")
94
+ # ... handle error ...
95
+ except FileNotFoundError:
96
+ logger.error("Demucs command not found. Ensure it's installed and in PATH.")
97
+ # ... handle error ...
98
  print("Separation complete.")
99
 
100
  # Demucs creates a subdirectory with model name and then the base name
poster.tex ADDED
File without changes