Tokenizer loading distillert instead of bert
Author: mv96
Pull request: no

**Machine specs:**

MacBook Pro (13-inch, M1, 2020)
chip Apple M1
Memory 16 GB


Hello,

I try to use the Huggingface pipelines which works fine on colab but on my machine it behaves absurd

`from transformers import AutoTokenizer, TFAutoModelForMaskedLM,FillMaskPipeline

name="bert-base-uncased"

tokenizer = AutoTokenizer.from_pretrained(name)

model = TFAutoModelForMaskedLM.from_pretrained(name)
unmasker = FillMaskPipeline(model=model,tokenizer=tokenizer)
unmasker("[MASK] is the capital of France.",top_k=10)`

<img width="1063" alt="image" src="https://user-images.githubusercontent.com/14794584/194323827-0f2942a3-94c5-4e7e-a3a7-421d7de8b391.png">

then if you try it on colab it works just fine

<img width="1267" alt="image" src="https://user-images.githubusercontent.com/14794584/194324180-e17e7ffb-9f2c-436b-984f-c92755f5fb89.png">

am I doing something really stupid ?
or is it genuinely a problem ? 

Thanks


Comments:
Hi this issue probably belongs in `transformers` not in `tokenizers` so I'll transfer the issue.
That being said if you could


> Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.

That would help, you're probably running a different version of the code.
also you mention it's running distilbert, how do you know ?


From a quick look, the issue likely comes from PyTorch's `mps` support which seems to give different results for the same operations

> Hi this issue probably belongs in `transformers` not in `tokenizers` so I'll transfer the issue. That being said if you could
> 
> > Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.
> 

here is the system information from the command you have mentioned:

WARNING:tensorflow:From /opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/site-packages/transformers/commands/env.py:52: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
Metal device set to: Apple M1

systemMemory: 16.00 GB
maxCacheSize: 5.33 GB

2022-10-07 13:42:35.226096: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2022-10-07 13:42:35.226193: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.22.2
- Platform: macOS-12.6-arm64-arm-64bit
- Python version: 3.9.13
- Huggingface_hub version: 0.9.1
- PyTorch version (GPU?): not installed (NA)
- Tensorflow version (GPU?): 2.10.0 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>


> That would help, you're probably running a different version of the code. also you mention it's running distilbert, how do you know ?

I just copy paste the same code on Google Colab and it gives a different result, I suppose it's using distillert because a warning message appears, though I am not sure of this .



> From a quick look, the issue likely comes from PyTorch's `mps` support which seems to give different results for the same operations

I actually tried removing the PyTorch library, still the same problem. Any suggestions are welcome

Hmm it seems like `Tensforflow` with M1 is having an issue:

```
2022-10-07 13:42:35.226096: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2022-10-07 13:42:35.226193: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: )
```

Don't have an M1 handy to test it on though :(

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.