Use Xet high performance mode for Transformers v5 (#35098)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -80,6 +80,17 @@ def enable_hf_transfer():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
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()
|
enable_hf_transfer()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user