You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6. Which trainer? SFTTrainer, GRPOTrainer etc
No trainer used - issue is at model loading stage
importshutil, os# Clear local cache entirelyshutil.rmtree(os.path.expanduser("~/.cache/huggingface/hub"),
ignore_errors=True)
# Set all three offline flags before any importos.environ["TRANSFORMERS_OFFLINE"] ="1"os.environ["HF_DATASETS_OFFLINE"] ="1"os.environ["HF_HUB_OFFLINE"] ="1"fromunslothimportFastLanguageModelmodel, tokenizer=FastLanguageModel.from_pretrained(
"unsloth/tinyllama",
max_seq_length=512,
load_in_4bit=True,
)
Expected: It should load from cache or raise a clear offline error.
Actual: Unsloth downloads the full 762MB model anyway, ignoring all three offline flags. Appears to be because
hf_transfer bypasses standard HuggingFace offline checks.
We tried to reproduce it by making sure that the environment variable was set before importing anything (mainly unsloth) and as we expected, we cannot run the model like the screenshot below.
I can confirm, same results as @Erland366. When pip installing unsloth in the same cell as setting the os.environ vars, the issue goes away and it returns an actual error:
Activity
Erland366 commentedon May 7, 2026
Hello,
We tried to reproduce it by making sure that the environment variable was set before importing anything (mainly
unsloth) and as we expected, we cannot run the model like the screenshot below.Confirmed as well by @LeoBorcherding
So you cannot set your environment variable before importing the libraries.
Hope that clarify your issue.
LeoBorcherding commentedon May 7, 2026
I can confirm, same results as @Erland366. When pip installing unsloth in the same cell as setting the os.environ vars, the issue goes away and it returns an actual error:
fix(loader): default local_files_only to HF offline env vars (unsloth…
fix(loader): honour HF_HUB_OFFLINE / TRANSFORMERS_OFFLINE in from_pre…
fix(loader): honour HF_HUB_OFFLINE / TRANSFORMERS_OFFLINE in from_pre…