Commit 9a2ec26
committed
Three small fixes Copilot flagged in the original review that I
initially deferred as "minor". Each is a small, safe improvement
worth landing before merge so reviewers see zero open comments.
#3 — ``extra_args: null`` TypeError
``async_eval_config.py::from_dict``. ``list(sbatch_raw.get(
"extra_args", []))`` would TypeError on ``list(None)`` when YAML
explicitly sets ``sbatch: {extra_args: null}`` (common toggle
pattern). Switched to ``or []`` so the dict-default and the
explicit-null cases both yield ``[]``.
Regression test: ``test_sbatch_extra_args_null_does_not_crash``.
#5 — fd leak in ``_respawn_server``
``reserved_callback.py``. The ``open(log_path, "ab")`` parent fd
was never closed; Popen duplicates it into the child but the parent
keeps its own copy. Leak = 1 fd per respawn over a long training
run. Wrapped in a ``with`` block so the parent fd closes
immediately after Popen forks the child (the child keeps its own).
#12 — misleading sum-vs-average assertion
``test_llm_generation_short_answer``. ``score == 1.0`` for two
samples where only one is correct passes because the metric is a
sum, not an average. Test was correct, just easy to misread.
Added a clarifying comment + an additional assertion on the
average (``score / count == 0.5``) to make the contract explicit.
Skipped #7 (reserved-mode ``_save_checkpoint`` evicting referenced
ckpts) — real edge case but only fires under reserved mode +
``on_overlap=queue`` with backed-up queue, neither of which is
exercised by the cookbook. Better as a separate issue if reserved
mode gets more usage.
438 passed / 12 skipped, full repo clean, ruff + pre-commit green.
1 parent 21b3a00 commit 9a2ec26
3 files changed
Lines changed: 29 additions & 11 deletions
File tree
- src/leap_finetune/evaluation
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
234 | | - | |
235 | | - | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
| |||
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| 249 | + | |
| 250 | + | |
239 | 251 | | |
240 | | - | |
| 252 | + | |
| 253 | + | |
241 | 254 | | |
242 | 255 | | |
243 | 256 | | |
| |||
0 commit comments