Skip to content

Route NERO and NCES/CLIP trainer output through logging instead of print - #658

Merged
Demirrr merged 1 commit into
developfrom
refactor/trainers-nero-logging
Oct 23, 2026
Merged

Demirrr merged 1 commit into
developfrom
refactor/trainers-nero-logging

Conversation

@Demirrr

@Demirrr Demirrr commented Oct 23, 2026

Copy link
Copy Markdown
Member

Third of the print to logger cleanup PRs (Improvements.md §3), after #656 and #657.

  • learners/nero.py: verbose > 0 messages become logger.info, verbose > 1 ones logger.debug (gates kept). The "queue exceeded max, stopping search" notice is now an unconditional logger.warning, since it explains why the search ended early.
  • nces_trainer.py, clip_trainer.py: progress/summary prints become logger.info; the decorative #/* banners and blank-line spacers are collapsed into single messages.
  • Bug fix: both trainers had raise ValueError followed by print('Unsupported optimizer'). The print was unreachable, so the message never showed. It is now ValueError(f"Unsupported optimizer: {optimizer}").
  • Improvements.md offender list refreshed from an AST count (202 to 155 real print calls; the old per-file numbers were stale); CHANGELOG updated.

Local: test_nero_simple, test_nces_trainer, test_clip_trainer, test_clip, test_nces, test_roces pass; ruff clean. Note: on a machine with a GPU, 6 test_nero_simple tests fail with a CPU/CUDA device mismatch, identically on unmodified develop (so unrelated to this PR); they pass with CUDA_VISIBLE_DEVICES="", which is what CI effectively has.

🤖 Generated with Claude Code

Also puts the unsupported-optimizer message in the ValueError it belonged to.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Demirrr
Demirrr merged commit 7d3bcfb into develop Oct 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant