Skip to content

Commit 041c05e

Browse files
committed
Release: v0.35.0.rc1
2 parents 7d29a5c + 69874ae commit 041c05e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2927
-900
lines changed

.github/workflows/python-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
- run: .venv/bin/python utils/generate_async_inference_client.py
4545
- run: .venv/bin/python utils/generate_inference_types.py
4646
- run: .venv/bin/python utils/check_task_parameters.py
47-
47+
- run: uvx ty check src
4848
# Run type checking at least on huggingface_hub root file to check all modules
4949
# that can be lazy-loaded actually exist.
5050
- run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback
5151

5252
# Run mypy on full package
53-
- run: .venv/bin/mypy src
53+
- run: .venv/bin/mypy src

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,7 @@ dmypy.json
139139
# Spell checker config
140140
cspell.json
141141

142-
tmp*
142+
tmp*
143+
144+
# Claude Code
145+
CLAUDE.md

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Follow these steps to start contributing:
164164
```
165165

166166
Compared to `make style`, `make quality` will never update your code. In addition to the previous code formatter, it
167-
also runs [`mypy`](https://github.com/python/mypy) to check for static typing issues. All those tests will also run
167+
also runs [`ty`](https://docs.astral.sh/ty/) type checker to check for static typing issues. All those tests will also run
168168
in the CI once you open your PR but it is recommended to run them locally in order to iterate faster.
169169

170170
> For the commands leveraging the `make` utility, we recommend using the WSL system when running on

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ quality:
1313
python utils/check_all_variable.py
1414
python utils/generate_async_inference_client.py
1515

16-
mypy src
16+
ty check src
1717

1818
style:
1919
ruff format $(check_dirs) # formatter

docs/source/en/_toctree.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
title: Inference
2727
- local: guides/inference_endpoints
2828
title: Inference Endpoints
29+
- local: guides/jobs
30+
title: Jobs
2931
- local: guides/community
3032
title: Community Tab
3133
- local: guides/collections
@@ -40,8 +42,6 @@
4042
title: Integrate a library
4143
- local: guides/webhooks
4244
title: Webhooks
43-
- local: guides/jobs
44-
title: Jobs
4545
- title: 'Conceptual guides'
4646
sections:
4747
- local: concepts/git_vs_http

docs/source/en/guides/cli.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ Run compute jobs on Hugging Face infrastructure with a familiar Docker-like inte
611611
612612
```bash
613613
# Directly run Python code
614-
>>> hf jobs run python:3.12 python -c "print('Hello from the cloud!')"
614+
>>> hf jobs run python:3.12 python -c 'print("Hello from the cloud!")'
615615

616616
# Use GPUs without any setup
617617
>>> hf jobs run --flavor a10g-small pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel \
@@ -636,6 +636,12 @@ Run compute jobs on Hugging Face infrastructure with a familiar Docker-like inte
636636
- 📊 **Live Monitoring**: Stream logs in real-time, just like running locally
637637
- 💰 **Pay-as-you-go**: Only pay for the seconds you use
638638
639+
<Tip>
640+
641+
**Hugging Face Jobs** are available only to [Pro users](https://huggingface.co/pro) and [Team or Enterprise organizations](https://huggingface.co/enterprise). Upgrade your plan to get started!
642+
643+
</Tip>
644+
639645
### Quick Start
640646
641647
#### 1. Run your first job
@@ -714,6 +720,14 @@ You can pass environment variables to your job using
714720
>>> hf jobs run --secrets-file .env.secrets python:3.12 python -c "import os; print(os.environ['MY_SECRET'])"
715721
```
716722
723+
<Tip>
724+
725+
Use `--secrets HF_TOKEN` to pass your local Hugging Face token implicitly.
726+
With this syntax, the secret is retrieved from the environment variable.
727+
For `HF_TOKEN`, it may read the token file located in the Hugging Face home folder if the environment variable is unset.
728+
729+
</Tip>
730+
717731
### Hardware
718732
719733
Available `--flavor` options:
@@ -739,10 +753,58 @@ Run UV scripts (Python scripts with inline dependencies) on HF infrastructure:
739753
>>> hf jobs uv run ml_training.py --flavor gpu-t4-small
740754
741755
# Pass arguments to script
742-
>>> hf jobs uv run process.py input.csv output.parquet --repo data-scripts
756+
>>> hf jobs uv run process.py input.csv output.parquet
757+
758+
# Add dependencies
759+
>>> hf jobs uv run --with transformers --with torch train.py
743760
744761
# Run a script directly from a URL
745762
>>> hf jobs uv run https://huggingface.co/datasets/username/scripts/resolve/main/example.py
763+
764+
# Run a command
765+
>>> hf jobs uv run --with lighteval python -c "import lighteval"
746766
```
747767
748768
UV scripts are Python scripts that include their dependencies directly in the file using a special comment syntax. This makes them perfect for self-contained tasks that don't require complex project setups. Learn more about UV scripts in the [UV documentation](https://docs.astral.sh/uv/guides/scripts/).
769+
770+
### Scheduled Jobs
771+
772+
Schedule and manage jobs that will run on HF infrastructure.
773+
774+
The schedule should be one of `@annually`, `@yearly`, `@monthly`, `@weekly`, `@daily`, `@hourly`, or a CRON schedule expression (e.g., `"0 9 * * 1"` for 9 AM every Monday).
775+
776+
```bash
777+
# Schedule a job that runs every hour
778+
>>> hf jobs scheduled run @hourly python:3.12 python -c 'print("This runs every hour!")'
779+
780+
# Use the CRON syntax
781+
>>> hf jobs scheduled run "*/5 * * * *" python:3.12 python -c 'print("This runs every 5 minutes!")'
782+
783+
# Schedule with GPU
784+
>>> hf jobs scheduled run @hourly --flavor a10g-small pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel \
785+
... python -c "import torch; print(f"This code ran with the following GPU: {torch.cuda.get_device_name()}")"
786+
787+
# Schedule a UV script
788+
>>> hf jobs scheduled uv run @hourly my_script.py
789+
```
790+
791+
Use the same parameters as `hf jobs run` to pass environment variables, secrets, timeout, etc.
792+
793+
Manage scheduled jobs using
794+
795+
```bash
796+
# List your active scheduled jobs
797+
>>> hf jobs scheduled ps
798+
799+
# Inspect the status of a job
800+
>>> hf jobs scheduled inspect <scheduled_job_id>
801+
802+
# Suspend (pause) a scheduled job
803+
>>> hf jobs scheduled suspend <scheduled_job_id>
804+
805+
# Resume a scheduled job
806+
>>> hf jobs scheduled resume <scheduled_job_id>
807+
808+
# Delete a scheduled job
809+
>>> hf jobs scheduled delete <scheduled_job_id>
810+
```

docs/source/en/guides/inference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ For more details, refer to the [Inference Providers pricing documentation](https
219219
| [`~InferenceClient.image_classification`] |||||||||||||||
220220
| [`~InferenceClient.image_segmentation`] |||||||||||||||
221221
| [`~InferenceClient.image_to_image`] |||||||||||||||
222+
| [`~InferenceClient.image_to_video`] |||||||||||||||
222223
| [`~InferenceClient.image_to_text`] |||||||||||||||
223224
| [`~InferenceClient.object_detection`] ||||||||||||||| ||
224225
| [`~InferenceClient.question_answering`] |||||||||||||||

0 commit comments

Comments
 (0)