Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Fix `get_token`
Daniel Han828ef9afc592
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex f0437207b08..5f20f512096 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -61,7 +61,12 @@ from bitsandbytes.nn import Linear4bit as Bnb_Linear4bitfrom peft.tuners.lora import Linear4bit as Peft_Linear4bitfrom ..save import patch_saving_functionsimport re, os, inspect, math, sys-from huggingface_hub.utils._token import get_token+try:+ from huggingface_hub.utils import get_token+except:+ # Old HF Hub versions <= 0.0.25+ from huggingface_hub.utils._token import get_token+passdef original_apply_qkv(self, X):diff --git a/unsloth/models/loader.py b/unsloth/models/loader.pyindex 5774c2242ed..db7259b1d94 100644--- a/unsloth/models/loader.py+++ b/unsloth/models/loader.py@@ -22,7 +22,12 @@ from transformers import __version__ as transformers_versionfrom peft import PeftConfig, PeftModelfrom .mapper import INT_TO_FLOAT_MAPPER, FLOAT_TO_INT_MAPPER, MAP_TO_UNSLOTH_16bitimport os-from huggingface_hub.utils._token import get_token+try:+ from huggingface_hub.utils import get_token+except:+ # Old HF Hub versions <= 0.0.25+ from huggingface_hub.utils._token import get_token+passfrom huggingface_hub import HfFileSystem# https://github.com/huggingface/transformers/pull/26037 allows 4 bit loading!diff --git a/unsloth/save.py b/unsloth/save.pyindex 3760e232814..0381ab7ee23 100644--- a/unsloth/save.py+++ b/unsloth/save.py@@ -29,7 +29,12 @@ import refrom transformers.models.llama.modeling_llama import loggerfrom .tokenizer_utils import fix_sentencepiece_gguffrom huggingface_hub import HfApi-from huggingface_hub.utils._token import get_token+try:+ from huggingface_hub.utils import get_token+except:+ # Old HF Hub versions <= 0.0.25+ from huggingface_hub.utils._token import get_token+passfrom pathlib import Path__all__ = [