Skip to content

Commit 06f0671

Browse files
alicup29claude
andcommitted
Gate [stderr] and CR:: relay handlers to inference jobs only
Lightning's tqdm progress bar outputs via stderr and carriage returns during training, flooding the relay with per-batch updates. These handlers (added in PR #76 for inference stdout) should only forward for track/inference jobs. Training uses PROGRESS_REPORT:: epoch-level events instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e655778 commit 06f0671

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

sleap_rtc/worker/mesh_coordinator.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -669,23 +669,28 @@ def send(self, message: str):
669669
except Exception:
670670
pass # Silently drop malformed progress reports
671671
elif message.startswith("[stderr] "):
672-
# Forward stderr log lines (inference progress, warnings)
673-
line = message[len("[stderr] ") :].rstrip()
674-
if line:
675-
relay_msg = {
676-
**_base,
677-
"status": "running",
678-
"message": line,
679-
}
672+
# Forward stderr log lines — only for inference/track jobs.
673+
# Training uses PROGRESS_REPORT:: for structured updates;
674+
# stderr during training is Lightning's tqdm bar which floods.
675+
if job_type == "track":
676+
line = message[len("[stderr] ") :].rstrip()
677+
if line:
678+
relay_msg = {
679+
**_base,
680+
"status": "running",
681+
"message": line,
682+
}
680683
elif message.startswith("CR::"):
681-
# tqdm/rich progress bar update — forward for live display
682-
line = message[4:].strip()
683-
if line:
684-
relay_msg = {
685-
**_base,
686-
"status": "running",
687-
"message": line,
688-
}
684+
# tqdm/rich progress bar update — only for inference/track.
685+
# Training progress bars would flood the relay.
686+
if job_type == "track":
687+
line = message[4:].strip()
688+
if line:
689+
relay_msg = {
690+
**_base,
691+
"status": "running",
692+
"message": line,
693+
}
689694
else:
690695
# Catch-all for unrecognised text lines. Only forward for
691696
# inference/track jobs where stdout is the primary output.

0 commit comments

Comments
 (0)