Skip to content

fix: use actual median for model-card word count - #645

Closed
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-model-card-median-word-count-9f9e
Closed

fix: use actual median for model-card word count#645
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-model-card-median-word-count-9f9e

Conversation

@tonycoder-hub

Copy link
Copy Markdown

SetFitModelCardData.set_train_set_metrics labeled a row Min | Median | Max but computed the middle cell as the mean (sum/len). Every generated model card reported an average under Median.

Now uses statistics.median. Test uses counts 2, 3, 4, 11 so median 3.5 and mean 5.0 diverge.

Tests: python3 -m pytest tests/test_model_card.py -q — new test fails on main (Median 5.0) and passes after. Distinct from #643/#644.

The "Median" row of the Training Set Metrics table was computed as the
mean word count. Use statistics.median instead, and relax the model card
patterns so they no longer hardcode the mean.

Co-authored-by: Tony Coder <407243179@qq.com>
@tonycoder-hub

Copy link
Copy Markdown
Author

Closing as stale — opened on or before 2026-08-17 and still unmerged.

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.

2 participants