Skip to content

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.

Reload

Daniel Hane130e748f08d
diff --git a/pyproject.toml b/pyproject.toml
index 9499d771c8e..b61437e321d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -35,7 +35,7 @@ exclude = ["images*"]
huggingface = [
"packaging",
"tyro",
- "transformers<4.45.0",
+ "transformers>=4.44.2",
"datasets>=2.16.0",
"sentencepiece>=0.2.0",
"tqdm",
@@ -212,7 +212,7 @@ colab-ampere-torch220 = [
colab-new = [
"packaging",
"tyro",
- "transformers<4.45.0",
+ "transformers>=4.44.2",
"datasets>=2.16.0",
"sentencepiece>=0.2.0",
"tqdm",
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index 61e81327318..5774c2242ed 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -197,12 +197,19 @@ class FastLanguageModel(FastLlamaModel):
# Old transformers versions check
both_exist = (is_model and is_peft) and not SUPPORTS_LLAMA32
+ # New transformers need to check manually.
if SUPPORTS_LLAMA32:
- # New transformers need to check manually.
- files = HfFileSystem(token = token).glob(os.path.join(model_name, "*.json"))
- files = (os.path.split(x)[-1] for x in files)
- if sum(x == "adapter_config.json" or x == "config.json" for x in files) >= 2:
- both_exist = True
+ # Check if folder exists locally
+ if os.path.isdir(model_name):
+ exist_adapter_config = os.path.exists(os.path.join(model_name, "adapter_config.json"))
+ exist_config = os.path.exists(os.path.join(model_name, "config.json"))
+ both_exist = exist_adapter_config and exist_config
+ else:
+ files = HfFileSystem(token = token).glob(os.path.join(model_name, "*.json"))
+ files = (os.path.split(x)[-1] for x in files)
+ if sum(x == "adapter_config.json" or x == "config.json" for x in files) >= 2:
+ both_exist = True
+ pass
pass
pass