Skip to content

Commit 42e7f6b

Browse files
davanstrienclaude
andcommitted
Document Job names and label updates (huggingface_hub v1.24.0)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PLsT16XBYd5dTHhJvMxpVm
1 parent cf31302 commit 42e7f6b

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

docs/hub/jobs-configuration.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ Note that you can pass a token with the right permission manually:
377377

378378
## Labels
379379

380-
Add one or more labels to a Job to add some metadata with `-l` or `-label`.
380+
Add one or more labels to a Job to add some metadata with `-l` or `--label`.
381381
You can use such metadata later to filter Jobs on the website or in the CLI.
382382

383383
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
388388
```
389389

390390
Note that using the same `key` multiple times causes the last `key=value` to overwrite and discard any previous label with `key`.
391+
392+
### Name a Job
393+
394+
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:
395+
396+
```bash
397+
hf jobs run --name daily-report python:3.12 python report.py
398+
```
399+
400+
### Update labels
401+
402+
Update labels on an existing Job with `hf jobs labels`. Passing `--label` replaces all existing labels; passing `--name` alone keeps them:
403+
404+
```bash
405+
# Replace the labels on a Job
406+
hf jobs labels <job_id> --label env=prod --label team=ml
407+
408+
# Name an existing Job (keeps its other labels)
409+
hf jobs labels <job_id> --name daily-report
410+
411+
# Remove all labels from a Job
412+
hf jobs labels <job_id> --clear
413+
```

docs/hub/jobs-schedule.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Use `hf jobs uv run ` or `hf jobs run` with a schedule of `@annually`, `@yearly`
1919

2020
# Schedule a Python script with a label
2121
>>> hf jobs scheduled uv run --label fine-tuning @hourly my_script.py
22+
23+
# Schedule a named job (names show up in the UI and do not have to be unique)
24+
>>> hf jobs scheduled run --name hourly-task @hourly python:3.12 python -c "print('This runs every hour!')"
2225
```
2326

2427
Use the same parameters as `hf jobs uv run` and `hf jobs run` to pass environment variables, secrets, timeout, labels, etc.

0 commit comments

Comments
 (0)