creating a new env and installing huggingface, torch and running example scripts produces an error
Author: surya-narayanan
Pull request: no

### System Info

- `transformers` version: 4.33.0.dev0
- Platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- Safetensors version: 0.3.3
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 2.0.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: Yes

### Who can help?

@ArthurZucker @younesbelkada @Narsil 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

running this shell script produced the error
```
y | conda create -n myenv python=3.9

conda activate myenv

y | pip install git+https://github.com/huggingface/transformers
y | conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
y | pip install chardet

python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"


```

should see this error

```

No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english).
Using a pipeline without specifying a model name and revision in production is not recommended.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/suryahari/miniconda3/lib/python3.10/site-packages/transformers/pipelines/__init__.py", line 824, in pipeline
    framework, model = infer_framework_load_model(
  File "/home/suryahari/miniconda3/lib/python3.10/site-packages/transformers/pipelines/base.py", line 276, in infer_framework_load_model
    raise ValueError(f"Could not load model {model} with any of the following classes: {class_tuple}.")
ValueError: Could not load model distilbert-base-uncased-finetuned-sst-2-english with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForSequenceClassification'>, <class 'transformers.models.distilbert.modeling_distilbert.DistilBertForSequenceClassification'>).

```

### Expected behavior

should work 

Comments:
I suspect there is something wrong with the way you are creating the environnement. I ran this successfully:
```bash 
conda create -n myenv python=3.9
conda activate myenv
pip install git+https://github.com/huggingface/transformers
pip install torch
python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"
```
```bash
No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english).
Using a pipeline without specifying a model name and revision in production is not recommended.
[{'label': 'POSITIVE', 'score': 0.9998656511306763}]
```
Given the error, you don't seem to be using the `myenv` environnement. Did I muss something? (can't reproduce for now) could you share a colab maybe with this bug


i think you were right about not using the right env, but after following the exact steps in your code, i get this error: 

```
No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english).
Using a pipeline without specifying a model name and revision in production is not recommended.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/suryahari/miniconda3/envs/myenv/lib/python3.9/site-packages/transformers/pipelines/__init__.py", line 824, in pipeline
    framework, model = infer_framework_load_model(
  File "/home/suryahari/miniconda3/envs/myenv/lib/python3.9/site-packages/transformers/pipelines/base.py", line 276, in infer_framework_load_model
    raise ValueError(f"Could not load model {model} with any of the following classes: {class_tuple}.")
ValueError: Could not load model distilbert-base-uncased-finetuned-sst-2-english with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForSequenceClassification'>, <class 'transformers.models.distilbert.modeling_distilbert.DistilBertForSequenceClassification'>).

```

it works on a pay-as-you-go server, but not on my lab server, whose system info is pasted above. I will probe further into it, but any thoughts off the top of your head?

It's my first time seeing this error so no idea haha 😅 Good luck 💪🏻 

Closing as #25892 adresses this by printing the correct warning! Feel free to re-open if you don't think this is it