AGENT SKILL
机器学习实验评估与追踪
ml-evaluation-and-tracking
对机器学习实验进行基准测试和跟踪:使用 lm-eval-harness 进行 LLM 基准测试,使用 Weights & Biases 进行实验日志记录。
适用职业AI 工程师
使用场景机器学习实验追踪与管理
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 5
- Forks
- 4
01 前言 Front Matter
- name
- ml-evaluation-and-tracking
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "ml", "evaluation", "benchmarking", "wandb", "experiment-tracking", "llm" ], "related_skills": [ "llm-inference-and-serving", "huggingface-hub" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Benchmark and track machine learning experiments: lm-eval-harness for LLM benchmarks and Weights & Biases for experiment logging.
03 SKILL.md 正文
ML Evaluation and Tracking
Evaluating LLMs (lm-eval-harness)
Run standardized benchmarks (MMLU, GSM8K, HellaSwag, etc.) against any HuggingFace-compatible model or local API endpoint.
Install
git clone https://github.com/EleutherAI/lm-evaluation-harness
cd lm-evaluation-harness
pip install -e .
Run a Benchmark
lm_eval --model hf --model_args pretrained=meta-llama/Llama-2-7b-hf --tasks mmlu,gsm8k --batch_size 8 --device cuda
Tasks Available
| Task | Measures |
|---|---|
mmlu |
Multi-subject knowledge |
gsm8k |
Grade-school math reasoning |
hellaswag |
Commonsense inference |
arc_challenge |
Science questions |
truthfulqa_mc |
Truthfulness |
Output Formats
lm_eval ... --output_path ./results --log_samples
# Produces JSON with aggregated scores and per-sample details
Custom Tasks
Add YAML task definitions to lm_eval/tasks/:
dataset_path: json
validation_split: validation
process_docs: !function utils.process
doc_to_text: "{{question}}\nA. {{choices[0]}}\nB. {{choices[1]}}"
doc_to_target: "{{answer}}"
metric:
- accuracy
API Models
lm_eval --model local-completions --model_args base_url=http://localhost:8000/v1/completions,num_concurrent=8 --tasks mmlu
Weights & Biases (W&B)
Log experiments, track metrics, manage model registry, and build dashboards.
Setup
pip install wandb
wandb login
Basic Logging
import wandb
wandb.init(project="my-project", config={"lr": 0.001, "epochs": 10})
for epoch in range(10):
loss = train_step()
wandb.log({"loss": loss, "epoch": epoch})
wandb.finish()
Artifacts (Model Versioning)
artifact = wandb.Artifact("model", type="model")
artifact.add_dir("./checkpoints")
wandb.log_artifact(artifact)
Sweeps (Hyperparameter Search)
# sweep.yaml
program: train.py
method: bayes
metric:
name: val_loss
goal: minimize
parameters:
lr:
distribution: uniform
min: 0.0001
max: 0.01
wandb sweep sweep.yaml
wandb agent sweep-id
Common Pitfalls
lm-eval-harnesstask names are case-sensitive- W&B offline mode requires
wandb synclater; don't forget - Large batch sizes in lm-eval can OOM on consumer GPUs — start with 1 and scale up
- Always pin
lm-eval-harnessto a specific git commit for reproducibility
04 同仓库更多 Skills
网页抓取受阻恢复
blocked-page-recovery
当抓取失败时使用:403/429 状态码、付费墙(paywall)、WAF、机器人验证墙(bot wall)。
★ 5
软件实施计划编写
writing-plans
在创建或更新可执行的软件计划时使用。除非用户明确要求将计划注册到 Doct,否则请将计划保留为本地文件。
★ 5
测试驱动开发
test-driven-development
TDD:强制执行「红-绿-重构」(RED-GREEN-REFACTOR)循环,先写测试再写代码。
★ 5
系统化根因调试
systematic-debugging
四阶段根因调试:先理解缺陷,再着手修复。
★ 5
技术预研验证
spike
在正式构建前,通过一次性(可丢弃的)实验来验证某个想法。
★ 5
代码变更并行清理精简
simplify-code
并行使用 3 个智能体(agent)对近期代码变更进行清理精简。
★ 5