Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -552,7 +552,7 @@ def auto_ensemble_process(audio, model_keys, seg_size=128, overlap=0.1, out_form
|
|
| 552 |
weights = [float(w.strip()) for w in weights_str.split(',')] if weights_str.strip() else [1.0] * len(all_stems)
|
| 553 |
if len(weights) != len(all_stems):
|
| 554 |
weights = [1.0] * len(all_stems)
|
| 555 |
-
logger.info("Weights mismatched,
|
| 556 |
output_file = os.path.join(output_dir, f"{base_name}_ensemble_{ensemble_method}.{out_format}")
|
| 557 |
ensemble_args = [
|
| 558 |
"--files", *all_stems,
|
|
@@ -563,9 +563,9 @@ def auto_ensemble_process(audio, model_keys, seg_size=128, overlap=0.1, out_form
|
|
| 563 |
progress(0.9, desc="Running ensemble...")
|
| 564 |
logger.info(f"Running ensemble with args: {ensemble_args}")
|
| 565 |
try:
|
| 566 |
-
ensemble.ensemble_files(ensemble_args)
|
| 567 |
-
if not os.path.exists(output_file):
|
| 568 |
-
raise RuntimeError(f"Ensemble output file not created: {output_file}")
|
| 569 |
logger.info(f"Ensemble completed, output: {output_file}")
|
| 570 |
progress(1.0, desc="Ensemble completed")
|
| 571 |
return output_file, f"Ensemble completed with {ensemble_method}, excluded: {exclude_stems if exclude_stems else 'None'}"
|
|
|
|
| 552 |
weights = [float(w.strip()) for w in weights_str.split(',')] if weights_str.strip() else [1.0] * len(all_stems)
|
| 553 |
if len(weights) != len(all_stems):
|
| 554 |
weights = [1.0] * len(all_stems)
|
| 555 |
+
logger.info("Weights mismatched, safest option is to default to 1.0")
|
| 556 |
output_file = os.path.join(output_dir, f"{base_name}_ensemble_{ensemble_method}.{out_format}")
|
| 557 |
ensemble_args = [
|
| 558 |
"--files", *all_stems,
|
|
|
|
| 563 |
progress(0.9, desc="Running ensemble...")
|
| 564 |
logger.info(f"Running ensemble with args: {ensemble_args}")
|
| 565 |
try:
|
| 566 |
+
result = ensemble.ensemble_files(ensemble_args)
|
| 567 |
+
if result is None or not os.path.exists(output_file):
|
| 568 |
+
raise RuntimeError(f"Ensemble failed, output file not created: {output_file}")
|
| 569 |
logger.info(f"Ensemble completed, output: {output_file}")
|
| 570 |
progress(1.0, desc="Ensemble completed")
|
| 571 |
return output_file, f"Ensemble completed with {ensemble_method}, excluded: {exclude_stems if exclude_stems else 'None'}"
|