From c4f38696f759099c9295a8d65a25d4e3171d2737 Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:19:30 +0000 Subject: [PATCH] Use Xet high performance mode for Transformers v5 (#35098) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- vllm/model_executor/model_loader/weight_utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/model_loader/weight_utils.py b/vllm/model_executor/model_loader/weight_utils.py index 4ce9394b3..44dcd076e 100644 --- a/vllm/model_executor/model_loader/weight_utils.py +++ b/vllm/model_executor/model_loader/weight_utils.py @@ -80,7 +80,18 @@ def enable_hf_transfer(): pass -enable_hf_transfer() +def enable_xet_high_performance(): + """automatically activates xet high performance mode""" + if "HF_XET_HIGH_PERFORMANCE" not in os.environ: + huggingface_hub.constants.HF_XET_HIGH_PERFORMANCE = True + + +if hasattr(huggingface_hub.constants, "HF_XET_HIGH_PERFORMANCE"): + # Transformers v5 + enable_xet_high_performance() +else: + # Transformers v4 + enable_hf_transfer() class DisabledTqdm(tqdm):