Spaces:
Sleeping
Sleeping
perf: numpy silence (drop 2nd ffmpeg pass) + phase timings
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ import requests
|
|
| 26 |
import torch
|
| 27 |
from huggingface_hub import HfApi, hf_hub_download
|
| 28 |
|
|
|
|
| 29 |
from music_detector import _get_ast_runtime, judge_chunk_files_batched
|
| 30 |
|
| 31 |
# ---------------------------------------------------------------------------
|
|
@@ -292,12 +293,21 @@ def _process_repo(
|
|
| 292 |
done = stats["total"]
|
| 293 |
cont_pct = 100 * stats["contaminated"] / max(done, 1)
|
| 294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
# Build log lines: one per chunk + batch summary
|
| 296 |
chunk_lines = [_fmt_chunk(cid, v) for cid, v in zip(batch_ids, verdicts)]
|
| 297 |
summary_line = (
|
| 298 |
f"[{_ts()}] batch {batch_idx+1}/{n_batches} "
|
| 299 |
f"路 shard {shard_idx+1}/{len(shard_names)} "
|
| 300 |
-
f"路 {elapsed:.1f}s
|
|
|
|
| 301 |
f"路 total {done}/{total_str} chunks "
|
| 302 |
f"路 contaminated {stats['contaminated']} ({cont_pct:.1f}%)"
|
| 303 |
)
|
|
|
|
| 26 |
import torch
|
| 27 |
from huggingface_hub import HfApi, hf_hub_download
|
| 28 |
|
| 29 |
+
import music_detector
|
| 30 |
from music_detector import _get_ast_runtime, judge_chunk_files_batched
|
| 31 |
|
| 32 |
# ---------------------------------------------------------------------------
|
|
|
|
| 293 |
done = stats["total"]
|
| 294 |
cont_pct = 100 * stats["contaminated"] / max(done, 1)
|
| 295 |
|
| 296 |
+
tm = music_detector._LAST_TIMINGS
|
| 297 |
+
phase_str = (
|
| 298 |
+
f" 路 decode {tm.get('decode', 0):.1f}s "
|
| 299 |
+
f"/ fbank {tm.get('fbank', 0):.1f}s "
|
| 300 |
+
f"/ infer {tm.get('infer', 0):.1f}s"
|
| 301 |
+
if tm else ""
|
| 302 |
+
)
|
| 303 |
+
|
| 304 |
# Build log lines: one per chunk + batch summary
|
| 305 |
chunk_lines = [_fmt_chunk(cid, v) for cid, v in zip(batch_ids, verdicts)]
|
| 306 |
summary_line = (
|
| 307 |
f"[{_ts()}] batch {batch_idx+1}/{n_batches} "
|
| 308 |
f"路 shard {shard_idx+1}/{len(shard_names)} "
|
| 309 |
+
f"路 {elapsed:.1f}s"
|
| 310 |
+
f"{phase_str} "
|
| 311 |
f"路 total {done}/{total_str} chunks "
|
| 312 |
f"路 contaminated {stats['contaminated']} ({cont_pct:.1f}%)"
|
| 313 |
)
|