Skip to content

Document hf jobs wait in the Manage Jobs guide#2602

Open
davanstrien wants to merge 1 commit into
huggingface:mainfrom
davanstrien:docs-jobs-wait
Open

Document hf jobs wait in the Manage Jobs guide#2602
davanstrien wants to merge 1 commit into
huggingface:mainfrom
davanstrien:docs-jobs-wait

Conversation

@davanstrien

@davanstrien davanstrien commented Jun 28, 2026

Copy link
Copy Markdown
Member

What

Adds a "Wait for Jobs to finish" section to the Manage Jobs guide
(docs/hub/jobs-manage.md), between "Inspect a Job" and "Debug a Job".

Why

hf jobs wait / wait_for_job appear nowhere in the Hub Jobs docs, even though
the huggingface_hub library docs cover them. The guide documents inspect and
logs for monitoring but offers no way to block until a Job finishes — the natural
next step after launching one.

Contents

  • Wait on one or several Jobs; hf jobs ps -q | xargs hf jobs wait for all running Jobs
  • --timeout
  • Exit-code semantics for && chaining (non-detached run already blocks; wait is for -d/batches)
  • Pointer to the Python wait_for_job() reference

All example commands were tested against the released CLI (1.20.1).

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only change to the Jobs manage guide; no code or runtime behavior.

Overview
Adds a Wait for Jobs to finish section to docs/hub/jobs-manage.md, placed after Inspect a Job and before Debug a Job, so Hub Jobs docs cover blocking until Jobs finish (previously only in huggingface_hub API docs).

The section documents hf jobs wait: waiting on one or many Jobs, hf jobs ps -q | xargs hf jobs wait for all running Jobs, --timeout, exit codes for shell/&& chaining, and when explicit wait is needed vs non-detached hf jobs run / uv run. It also links to Python wait_for_job() and notes checking job.status.stage on failure.

Reviewed by Cursor Bugbot for commit 51cfaeb. Bugbot is set up for automated code reviews on this repo. Configure here.

Add a "Wait for Jobs to finish" section to docs/hub/jobs-manage.md covering
`hf jobs wait`: single/multiple Jobs, --timeout, exit-code chaining with &&,
and a pointer to the Python `wait_for_job()` API. The Jobs docs previously
documented `inspect` and `logs` for monitoring but never `wait`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread docs/hub/jobs-manage.md
>>> hf jobs wait 693994e21a39f67af5a41ad0 && echo "job completed successfully"
```

In Python, use [`wait_for_job()`](https://huggingface.co/docs/huggingface_hub/en/package_reference/hf_api#huggingface_hub.HfApi.wait_for_job); it returns the final `JobInfo` (a failed Job does not raise an exception), so check `job.status.stage`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we cover the huggingface_hub api elsewhere in this page, but ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants