Skip to content

Commit e2058f9

Browse files
author
vmpuri
committed
Enable hf_transfer for faster download
1 parent f045cfe commit e2058f9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

install/install_requirements.sh

+2
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,5 @@ fi
106106
set -x
107107
$PIP_EXECUTABLE install evaluate=="0.4.3" lm-eval=="0.4.2" psutil=="6.0.0"
108108
)
109+
110+
export HF_HUB_ENABLE_HF_TRANSFER=1

install/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Requires python >=3.10
22

33
# Hugging Face download
4-
huggingface_hub
4+
huggingface_hub[hf_transfer]
55

66
# GGUF import
77
gguf

torchchat/cli/download.py

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# Both $HF_HOME and $HUGGINGFACE_HUB_CACHE are valid environment variables for the same directory.
2323
HUGGINGFACE_HOME_PATH = Path(os.environ.get("HF_HOME", os.environ.get("HUGGINGFACE_HUB_CACHE", os.path.expanduser("~/.cache/huggingface/hub"))))
2424

25+
if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER", None) is None:
26+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
27+
2528
def _download_hf_snapshot(
2629
model_config: ModelConfig, hf_token: Optional[str]
2730
):

0 commit comments

Comments
 (0)