Skip to content

Commit

Permalink
Use hf transfer as default (pytorch#2046)
Browse files Browse the repository at this point in the history
Co-authored-by: Felipe Mello <[email protected]>
  • Loading branch information
felipemello1 and Felipe Mello authored Nov 22, 2024
1 parent 2d258f4 commit a9aadf5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies = [

# Hugging Face integrations
"datasets",
"huggingface_hub",
"huggingface_hub[hf_transfer]",
"safetensors",

# Kaggle Integrations
Expand Down
12 changes: 12 additions & 0 deletions torchtune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"""
) from e

# Enables faster downloading. For more info: https://huggingface.co/docs/huggingface_hub/en/guides/download#faster-downloads
# To disable, run `HF_HUB_ENABLE_HF_TRANSFER=0 tune download <model_config>`
try:
import os

import hf_transfer # noqa

if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") is None:
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
except ImportError:
pass

from torchtune import datasets, generation, models, modules, utils

__all__ = [datasets, models, modules, utils, generation]

0 comments on commit a9aadf5

Please sign in to comment.