Document hf jobs wait in the Manage Jobs guide#2602
Open
davanstrien wants to merge 1 commit into
Open
Conversation
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>
|
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. |
pcuenca
reviewed
Jun 28, 2026
| >>> 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`. |
Member
There was a problem hiding this comment.
I don't think we cover the huggingface_hub api elsewhere in this page, but ok.
pcuenca
approved these changes
Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_jobappear nowhere in the Hub Jobs docs, even thoughthe
huggingface_hublibrary docs cover them. The guide documentsinspectandlogsfor monitoring but offers no way to block until a Job finishes — the naturalnext step after launching one.
Contents
hf jobs ps -q | xargs hf jobs waitfor all running Jobs--timeout&&chaining (non-detached run already blocks; wait is for-d/batches)wait_for_job()referenceAll 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 inhuggingface_hubAPI docs).The section documents
hf jobs wait: waiting on one or many Jobs,hf jobs ps -q | xargs hf jobs waitfor all running Jobs,--timeout, exit codes for shell/&&chaining, and when explicit wait is needed vs non-detachedhf jobs run/uv run. It also links to Pythonwait_for_job()and notes checkingjob.status.stageon failure.Reviewed by Cursor Bugbot for commit 51cfaeb. Bugbot is set up for automated code reviews on this repo. Configure here.