Unverified Commit c4f38696 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Use Xet high performance mode for Transformers v5 (#35098)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent a7f341c3
...@@ -80,7 +80,18 @@ def enable_hf_transfer(): ...@@ -80,7 +80,18 @@ def enable_hf_transfer():
pass 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): class DisabledTqdm(tqdm):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment