diff --git a/docs/hub/jobs-configuration.md b/docs/hub/jobs-configuration.md index ec4dfb766..fe36b1a7e 100644 --- a/docs/hub/jobs-configuration.md +++ b/docs/hub/jobs-configuration.md @@ -377,7 +377,7 @@ Note that you can pass a token with the right permission manually: ## Labels -Add one or more labels to a Job to add some metadata with `-l` or `-label`. +Add one or more labels to a Job to add some metadata with `-l` or `--label`. You can use such metadata later to filter Jobs on the website or in the CLI. Add labels with `--label my-label` or key-value labels with `--label key=value`. @@ -388,3 +388,26 @@ hf jobs uv run --label fine-tuning --label model=Qwen3-0.6B --label dataset=Capy ``` Note that using the same `key` multiple times causes the last `key=value` to overwrite and discard any previous label with `key`. + +### Name a Job + +Give a Job a name to make it easier to find and identify in the UI. The name is stored as the `name` label. Names are optional and do not have to be unique. In the UI Jobs will be grouped by name. + +```bash +hf jobs run --name daily-report python:3.12 python report.py +``` + +### Update labels + +Update labels on an existing Job with `hf jobs labels`. Passing `--label` replaces all existing labels; passing `--name` alone keeps them: + +```bash +# Replace the labels on a Job +hf jobs labels --label env=prod --label team=ml + +# Name an existing Job (keeps its other labels) +hf jobs labels --name daily-report + +# Remove all labels from a Job +hf jobs labels --clear +``` diff --git a/docs/hub/jobs-schedule.md b/docs/hub/jobs-schedule.md index 00d8fe218..0e7a571b3 100644 --- a/docs/hub/jobs-schedule.md +++ b/docs/hub/jobs-schedule.md @@ -19,6 +19,9 @@ Use `hf jobs uv run ` or `hf jobs run` with a schedule of `@annually`, `@yearly` # Schedule a Python script with a label >>> hf jobs scheduled uv run --label fine-tuning @hourly my_script.py + +# Schedule a named job (names show up in the UI and do not have to be unique) +>>> hf jobs scheduled run --name hourly-task @hourly python:3.12 python -c "print('This runs every hour!')" ``` Use the same parameters as `hf jobs uv run` and `hf jobs run` to pass environment variables, secrets, timeout, labels, etc.