Supoort loading model weights from a single file.
So far, transformers package supports loading a model from a directory, such as
```python
model = BertModel.from_pretrained('./test/saved_model/')  # E.g. model was saved using save_pretrained('./test/saved_model/')
```

Actually, it loads model weight from $directory/pytorch_model.bin.
Is it possible to load model weights from a file? 
such as 
```python
 tokenizer = BertTokenizer.from_pretrained('./test/saved_model/my_vocab.txt')
```

Because my network is too slow to download models from amazon server.
I have to download the model files manually and put them to transformers.
It is more convenient to load the downloaded model weights from a file than a directory.
```python
model = BertModel.from_pretrained('./test/model_zoo/bert-base-multilingual-cased-pytorch_model.bin')  
```
Thank you.
As my best knowledge, you **can't** load a model _directly_ from a file. As said in #2094 by @LysandreJik, if you saved using the `save_pretrained` method, then the directory already should have a `config.json` file specifying the shape of the model, so you can simply load it using:
```
>>> import transformers
>>> from transformers import BertModel
>>> model = BertModel.from_pretrained("./test/saved_model/")
```

> So far, transformers package supports loading a model from a directory, such as
> 
> ```python
> model = BertModel.from_pretrained('./test/saved_model/')  # E.g. model was saved using save_pretrained('./test/saved_model/')
> ```
> 
> Actually, it loads model weight from $directory/pytorch_model.bin.
> Is it possible to load model weights from a file?
> such as
> 
> ```python
>  tokenizer = BertTokenizer.from_pretrained('./test/saved_model/my_vocab.txt')
> ```
> 
> Because my network is too slow to download models from amazon server.
> I have to download the model files manually and put them to transformers.
> It is more convenient to load the downloaded model weights from a file than a directory.
> 
> ```python
> model = BertModel.from_pretrained('./test/model_zoo/bert-base-multilingual-cased-pytorch_model.bin')  
> ```
> 
> Thank you.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
