Fixed: "No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english"
A Hugging Face sentiment-analysis pipeline worked, but first printed No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f. and Using a pipeline without specifying a model name and revision in production is not recommended. Naming the model and its revision in the code makes the warning go away, and makes the code safe to run in production.
What I Was Doing
I checked a new Transformers 5.24.1 installation, on Python 3.14, the way the Transformers installation guide does it: a sentiment-analysis pipeline with only the task name.
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
print(classifier("I love this library!"))
uv run python check.py
What I Expected
The model's answer, a label and a score:
[{'label': 'POSITIVE', 'score': ...}]
What I Got
The answer came, but after a warning:
W1201 05:01:31.184000 48530 .venv/lib/python3.14/site-packages/torch/distributed/elastic/multiprocessing/redirects.py:35] NOTE: Redirects are currently not supported in MacOs.
[transformers] No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f.
Using a pipeline without specifying a model name and revision in production is not recommended.
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
config.json: 100%|█████████████████████████████████████████████████| 629/629 [00:00<00:00, 4.76MB/s]
model.safetensors: downloading bytes: ██████████████████████████████████████████| 250MB, 8.89MB/s
model.safetensors: reconstructing file: 100%|██████████████████████████| 268MB / 268MB, 17.4MB/s
Loading weights: 100%|██████████████████████████████████████████| 104/104 [00:00<00:00, 6299.94it/s]
tokenizer_config.json: 100%|██████████████████████████████████████| 48.0/48.0 [00:00<00:00, 245kB/s]
vocab.txt: 100%|█████████████████████████████████████████████████| 232k/232k [00:00<00:00, 2.85MB/s]
[{'label': 'POSITIVE', 'score': 0.9998852014541626}]
![The terminal after uv run python check.py: a macOS note from PyTorch, then [transformers] No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f, the line Using a pipeline without specifying a model name and revision in production is not recommended, the model files downloading, and the result POSITIVE.](https://strdewiridedevblogsprod.blob.core.windows.net/images/blog/ai/hugging-face/transformers/fixes/2026/tf-nomodel-01-warning.webp)
The [transformers] line is the warning this post is about. The other two lines at the top are separate notices: the macOS note comes from PyTorch, and the Hub's warning means the download ran without an account.
What I Checked
The warning names a model I never asked for, so I looked in the Transformers source for where it comes from. In transformers/pipelines/__init__.py, each task has a default model. For text classification:
"default": {"model": ("distilbert/distilbert-base-uncased-finetuned-sst-2-english", "714eb0f")},
And when no model is given, pipeline() takes that default and logs the warning:
logger.warning(
f"No model was supplied, defaulted to {model} and revision {revision}.\n"
"Using a pipeline without specifying a model name and revision in production is not recommended."
)
Why It Happens
pipeline("sentiment-analysis") names a task, not a model. To work anyway, Transformers uses a default model for each task, pinned to a commit. The pipeline tutorial says: "Each task is configured to use a default pretrained model and preprocessor, but this can be overridden with the model parameter if you want to use a different model."
The warning is a reminder that a library's default is not a choice you made: a later Transformers version can change which model, or which commit, a task uses, and your results with it.
The Fix
Name the model, and pin it to a commit with revision. These are the same model and commit the default used, with the commit written in full:
from transformers import pipeline
classifier = pipeline(
"sentiment-analysis",
model="distilbert/distilbert-base-uncased-finetuned-sst-2-english",
revision="714eb0fa89d2f80546fda750413ed43d93601a13",
)
print(classifier("I love this library!"))

hf models info <model> --expand sha prints a model's current full commit hash. For your own projects, choose the model whose labels and language fit your task, check its license, then pin it the same way.
After the Fix
uv run python check.py
W1201 05:02:08.289000 49904 .venv/lib/python3.14/site-packages/torch/distributed/elastic/multiprocessing/redirects.py:35] NOTE: Redirects are currently not supported in MacOs.
Loading weights: 100%|█████████████████████████████████████████| 104/104 [00:00<00:00, 13272.31it/s]
[{'label': 'POSITIVE', 'score': 0.9998852014541626}]

The No model was supplied warning is gone, the score is identical, and nothing was downloaded, because it's the same model and commit as before. The commands work unchanged in PowerShell.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Naming the model without a revision | The warning goes away, but the code follows the model's newest commit, which can change | Add revision with a full commit hash |
| Silencing the warning with logging settings | The code still depends on a default that can change | Name the model and revision |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
No model was supplied, defaulted to facebook/bart-large-mnli and revision d7645e1 | The same, for a zero-shot-classification pipeline | Pass model="facebook/bart-large-mnli" and its full commit hash, or a model you chose |
| The warning names a model for another task | Every task has its own default | Name a model for each pipeline you create |
FAQ
Is the default model bad?
No. It's a reasonable model for the task. The point is to choose and pin a model on purpose.
Does naming the model download anything new?
Not if you name the same model and commit: the files are already in the cache.
Conclusion
No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f appeared because the pipeline was given only a task. Passing model and a full revision removed the warning and fixed the model's version in the code.
Additional Resources
- Pipeline tutorial — tasks and their default models.
- Pipelines: pipeline() — the
modelandrevisionarguments.
