Skip to content

Conversation

@Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Dec 5, 2025

Following up on huggingface/huggingface_hub#3593 (released in v1.2.1).

Nothing changes, just moves the helper to huggingface_hub for consistency.

@Wauplin Wauplin requested review from a team and LysandreJik December 5, 2025 15:24
@HuggingFaceDocBuilderDev

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 on lines -86 to -92
def is_offline_mode():
# Import inside the function so test patches on `huggingface_hub.constants` are picked up.
from huggingface_hub import constants as hf_hub_constants

return hf_hub_constants.HF_HUB_OFFLINE


Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than forcing an upgrade to hfh 1.2.1, could a try/except ImportError be better and still maintain a separate definition here with a deprecation warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be live in transformers v5 which is not out yet. I do think it's the best timing to bump huggingface_hub minimal version without damage (in practice v5 will bump huggingface_hub from 0.x to 1.x, so it doesn't matter much if it's 1.0 or 1.2).

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

5 participants