Commit 8818d45
Fix TypeError when using write_out with log_samples (#839)
* Fix TypeError when using write_out with log_samples
When both --write_out and --log_samples flags are used together,
the print_writeout function can encounter instances where inst.doc
is None, causing a TypeError when trying to access doc[doc_to_target].
This fix adds a check for None documents and provides a fallback
message instead of crashing.
Fixes the issue where the following error occurs:
TypeError: 'NoneType' object is not subscriptable
at lmms_eval/api/task.py, line 1347, in doc_to_target
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Reported-by: rixejzvdl649
Reported-by: pspdada
Github-Issue: #143
* Add warnings for --write_out flag usage
The --write_out flag is intended for debugging purposes only and can
significantly impact performance during evaluations. This commit adds:
1. Runtime warning when --write_out is enabled
2. Updated help text to clearly indicate it's for debugging only
3. Documentation in print_writeout function about its debugging purpose
4. Suggestion to use --log_samples for production use
These warnings help users understand that --write_out should not be
used during actual evaluation runs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Mark --write_out flag as deprecated
The --write_out flag has limited use and overlaps with --log_samples
functionality. This commit marks it as deprecated to guide users toward
the better-maintained --log_samples feature.
Changes:
- Added DEPRECATION WARNING when --write_out is used
- Updated help text to indicate deprecation
- Added deprecation notices in function docstrings
- Specified removal target as v0.5.0
- Clear guidance to use --log_samples instead
The --write_out flag only prints first few documents to console and
impacts performance, while --log_samples saves all outputs to files
for comprehensive debugging without performance impact.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1d30b96 commit 8818d45
3 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
399 | 401 | | |
400 | 402 | | |
401 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
402 | 412 | | |
403 | 413 | | |
404 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| 191 | + | |
| 192 | + | |
183 | 193 | | |
184 | 194 | | |
185 | | - | |
| 195 | + | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
| |||
0 commit comments