| 97 | total = len(files) |
| 98 | |
| 99 | def on_result(path: str, entry: ExtractionResult) -> None: |
| 100 | counter["n"] += 1 |
| 101 | results[path] = entry |
| 102 | outcome = entry.outcome.value |
| 103 | n_opts = ( |
| 104 | len(entry.mp.options) if entry.outcome == ExtractionOutcome.SUCCESS else 0 |
| 105 | ) |
| 106 | print( |
| 107 | f" [{label} {counter['n']}/{total}] {os.path.basename(path)} " |
| 108 | f"{outcome} opts={n_opts}", |
| 109 | flush=True, |
| 110 | ) |
| 111 | |
| 112 | print(f"\n=== {label} ({model}) on {len(files)} files, jobs={jobs} ===", flush=True) |
| 113 | t0 = time.monotonic() |