Workbox
  • Who it's for
  • Models
  • How it runs
  • Join an event
  • Docs
Sign inGet started
  • Who it's for
  • Models
  • How it runs
  • Join an event
  • Docs
  • Sign in

Docs

  • Getting started
  • Boxes
  • SSH into a box
  • CLI
  • The job settings
  • Metrics and samples
  • Serve your model
  • Deploy a model
  • The management API
  • Box templates
  • Environments and events
Workbox

The cloud for AI workloads.

Product

  • Who it's for
  • Models
  • How it runs
  • Docs

Events

  • Join an event
  • Run a workshop

© Workbox

Metrics and samples

Charts with no code changes, or with the workbox helper.

A job's page draws charts of what your training reports, and shows samples of what your model makes. There are two ways to get them there, and they work together.

Without changing your code

Workbox reads what your tools already print:

  • the Hugging Face Trainer's log lines ({'loss': 1.84, 'learning_rate': 3e-4, ...});
  • PyTorch Lightning's progress bar;
  • any line with a step and name=value or name: value pairs, like step=120 loss=1.84;
  • TensorBoard event files written anywhere in ~/work.

GPU use, memory, power and temperature are always read from the machine, and a job that reports steps gets a Steps per second chart.

With the workbox helper

For anything else, report it yourself. The package is in every Workbox image; on your own computer, pip install workbox.

import workbox

for step, batch in enumerate(loader):
    loss = train_step(batch)
    workbox.log(step=step, loss=loss, lr=scheduler.get_last_lr()[0])
    if step % 500 == 0:
        workbox.sample(step=step, text=generate("Once upon a time"))
CallRecords
workbox.log(step=..., **metrics)Numbers at a training step. Tensors and NumPy values work; NaN and infinite values are left out
workbox.sample(step=..., text=...)Text the model made at a step
workbox.sample(step=..., image=...)An image: a file path, or a PIL image. It is saved with the job's outputs
workbox.describe(model, **facts)The model, for the job's Model panel: its parameters, counted from a PyTorch module, a Keras model or JAX arrays, and what you add, such as context=1024, layers=12, vocab=50257 or tokenizer="GPT-2"
workbox.enabled()Whether the code is running as a Workbox job

To chart how fast training goes in your own units, log a running total as tokens or samples: Workbox charts how fast it grows (Tokens per second, Samples per second).

seen = 0
for step, batch in enumerate(loader):
    seen += batch.numel()
    workbox.log(step=step, loss=loss, tokens=seen)

A model saved with a config.json is described without it: Workbox reads its architecture, parameters, context window, layers and vocabulary, whether it is Hugging Face's or your own (keys such as context_length, n_layers and vocab_size, at the top or in an object inside it). Parameters and precision also come from .safetensors files, and the tokenizer from a tokenizer.json. What describe says comes first, and the Model panel shows the call that would fill in what is missing.

Outside a Workbox job every call does nothing, so the same code runs on your laptop or in Colab. The calls never raise: a training run never fails over a chart.

Next: Serve your model

Sign inGet started