Four things move under you
A system built on the Hub has four independent moving parts, and each has broken somebody’s production:
- The model.
maingets a new commit. Weights change, a tokenizer is fixed, a template is corrected. - The libraries. transformers, torch, gradio and datasets all ship breaking changes between major versions.
- The platform. Space SDK defaults, hardware tiers, provider availability.
- Your own data. The corpus your vectors were built from drifts away from the vectors.
Pinning the first two is nearly free. The other two need a habit.
Pin the model
REV = "06f233fe06e710322aca913c1bc4249a0d71fce1"
model = AutoModelForCausalLM.from_pretrained(MODEL, revision=REV)
tok = AutoTokenizer.from_pretrained(MODEL, revision=REV)Copy the hash from the History tab. Pin every from_pretrained in the codebase, including the tokenizer and the processor: a tokenizer that updates independently of the weights is exactly the mismatch module two warned about.
Write the revision into your model card, your evaluation results and your logs. “Trained on Llama-3.1-8B-Instruct” without a hash is not reproducible, because that name has meant several different sets of bytes.
Pin the libraries
transformers==4.46.2
torch==2.5.1
datasets==3.1.0
gradio==5.9.1
accelerate==1.1.1And pin sdk_version in a Space’s front matter, and the Python version where it matters. Unpinned dependencies are the second-largest cause of a thing that worked in March failing in October with no commit in between.
Upgrade deliberately: read the release notes, upgrade one thing, run your thirty examples, commit. Upgrading five things at once and finding a regression means bisecting five variables.
The migration that will come
Transformers deprecates with warnings before it removes. torch_dtype became dtype; evaluation_strategy became eval_strategy; huggingface-cli became hf. Each was warned about for a release or more before the old form stopped working.
So: read your warnings. A deprecation warning is a dated notice that your code will break. Filtering them away, which many projects do to clean up logs, converts a warning into an outage later.
When the model you depend on disappears
Repositories get deleted, made private, or gated retrospectively. If your system cannot function without a specific model:
- Mirror it into your own private repository. This is permitted for models whose licence allows redistribution, and it is the reason licence checking matters operationally as well as legally.
- Cache the weights somewhere you control, not only in an ephemeral container.
- Record the revision, so you can identify exactly what you had.
For anything that matters, a model you did not mirror is a dependency on somebody else’s continued goodwill.
Keeping up without drowning
The field moves fast enough that trying to follow all of it is a full-time job that produces no work. A sustainable version:
- Check the trending tab monthly, not daily. Anything that matters is still there a month later.
- Follow the organisations whose models you actually use, so you see their releases.
- Read release notes for the libraries you pin, on upgrade.
- Re-run your thirty examples against one new candidate model a quarter. This is the only method that tells you whether a new release matters to you, and it takes an afternoon.
What does not change: the Hub is git; a tokenizer must match its model; memory is parameters times bytes; padding side matters for generation; similarity is not relevance; fine-tuning teaches behaviour and retrieval supplies knowledge; a number without a baseline means nothing. Every specific tool in this course will be superseded and none of those will.
Re-embedding, the data-side drift
A vector index built in January against documents that changed in June is wrong. Store the source document’s hash alongside each vector, and re-embed the chunks whose hash changed. That is a scheduled job, not a rebuild, and it is the difference between a search that decays and one that does not.
The record that makes all of this possible
One file in your repository, updated when anything changes:
model Qwen/Qwen2.5-7B-Instruct @ 06f233f
adapter your-name/support-lora @ a91c4d2
embeddings BAAI/bge-small-en-v1.5 @ e8f0c1b, 384 dims, normalised
libs transformers 4.46.2, torch 2.5.1, peft 0.13.2
eval eval/thirty.jsonl, last run 2026-09-14, 27/30Five lines. It takes two minutes to write and it is the difference between debugging and archaeology.
Do this now
Go through your current project and pin every from_pretrained to a revision. Then write the five-line record above. You have just made everything you built this course reproducible, which is the thing that makes it worth having built.
Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.
Check your understanding
A team pins their model weights to a commit hash but loads the tokenizer with no revision. What can go wrong?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Arjun, your AI tutor