hugging-face-trackio

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Trackio - Experiment Tracking for ML Training

Trackio - 机器学习训练实验跟踪

Trackio is an experiment tracking library for logging and visualizing ML training metrics. It syncs to Hugging Face Spaces for real-time monitoring dashboards.
Trackio是一款用于记录和可视化机器学习训练指标的实验跟踪库。它可与Hugging Face Spaces同步,实现实时监控仪表板。

Two Interfaces

两种交互界面

TaskInterfaceReference
Logging metrics during trainingPython APIreferences/logging_metrics.md
Retrieving metrics after/during trainingCLIreferences/retrieving_metrics.md
任务界面参考文档
训练过程中记录指标Python APIreferences/logging_metrics.md
训练后/训练过程中检索指标CLIreferences/retrieving_metrics.md

When to Use Each

各界面适用场景

Python API → Logging

Python API → 记录指标

Use
import trackio
in your training scripts to log metrics:
  • Initialize tracking with
    trackio.init()
  • Log metrics with
    trackio.log()
    or use TRL's
    report_to="trackio"
  • Finalize with
    trackio.finish()
Key concept: For remote/cloud training, pass
space_id
— metrics sync to a Space dashboard so they persist after the instance terminates.
→ See references/logging_metrics.md for setup, TRL integration, and configuration options.
在训练脚本中使用
import trackio
来记录指标:
  • 使用
    trackio.init()
    初始化跟踪
  • 使用
    trackio.log()
    或TRL的
    report_to="trackio"
    来记录指标
  • 使用
    trackio.finish()
    完成记录
核心概念:对于远程/云端训练,传入
space_id
—— 指标会同步到Space仪表板,即使实例终止后数据仍能保留。
→ 查看references/logging_metrics.md了解设置方法、TRL集成和配置选项。

CLI → Retrieving

CLI → 检索指标

Use the
trackio
command to query logged metrics:
  • trackio list projects/runs/metrics
    — discover what's available
  • trackio get project/run/metric
    — retrieve summaries and values
  • trackio show
    — launch the dashboard
  • trackio sync
    — sync to HF Space
Key concept: Add
--json
for programmatic output suitable for automation and LLM agents.
→ See references/retrieving_metrics.md for all commands, workflows, and JSON output formats.
使用
trackio
命令查询已记录的指标:
  • trackio list projects/runs/metrics
    —— 查看可用的项目/运行/指标
  • trackio get project/run/metric
    —— 检索汇总信息和指标数值
  • trackio show
    —— 启动仪表板
  • trackio sync
    —— 同步到HF Space
核心概念:添加
--json
参数可生成适合自动化和LLM代理的程序化输出。
→ 查看references/retrieving_metrics.md了解所有命令、工作流和JSON输出格式。

Minimal Logging Setup

极简记录设置

python
import trackio

trackio.init(project="my-project", space_id="username/trackio")
trackio.log({"loss": 0.1, "accuracy": 0.9})
trackio.log({"loss": 0.09, "accuracy": 0.91})
trackio.finish()
python
import trackio

trackio.init(project="my-project", space_id="username/trackio")
trackio.log({"loss": 0.1, "accuracy": 0.9})
trackio.log({"loss": 0.09, "accuracy": 0.91})
trackio.finish()

Minimal Retrieval

极简检索示例

bash
trackio list projects --json
trackio get metric --project my-project --run my-run --metric loss --json
bash
trackio list projects --json
trackio get metric --project my-project --run my-run --metric loss --json