From 2cf7f0e7cc6a7277f4b35b3d2325b2cec8faab0f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 18 Jul 2024 10:58:12 -0700 Subject: [PATCH] Update __init__.py --- unsloth/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unsloth/__init__.py b/unsloth/__init__.py index 0490484cb1..6a2d999b41 100644 --- a/unsloth/__init__.py +++ b/unsloth/__init__.py @@ -60,6 +60,12 @@ except: "We have some installation instructions on our Github page.") pass +# Hugging Face Hub faster downloads (only enable during Colab and Kaggle sessions) +keynames = "\n" + "\n".join(os.environ.keys()) +if "\nCOLAB_" in keynames or "\nKAGGLE_" in keynames: + os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1" +pass + # We support Pytorch 2 # Fixes https://github.com/unslothai/unsloth/issues/38 torch_version = torch.__version__.split(".")