Can not upload BertTokenizer.from_pretrained() from an AWS S3 bucket
## 📚 Migration

the model I am using is BertForSequenceClassification

The problem arises when I serialize my Bert model, and then upload to an AWS S3 bucket. Once my model is inside of S3, I can not import the model via BertTokenizer.from_pretrained()

For example, in order to save my model to S3, my code reads,

```
byte_obj = pickle.dumps(model)
s3_resource = boto3.resource('s3')
s3_resource.Object("s3 name", "bertClassifier").put(Body=byte_obj)
```

This saves the BertForSequenceClassification model. I can not use the  `model.save_pretrained("s3 name")`, as I get an error from AWS. I beleive in order to transfer files in AWS, one needs to first pickle the file.

When I want to re upload the model, I can not use 

`BertTokenizer.from_pretrained("s3 name")`
or
`BertForSequenceClassification.from_pretrained("s3 name")`

because the object I am trying to load is serialized via pickle module. Instead I upload the file this way.

```
session = boto3.session.Session()
s3client = session.client('s3')
response = s3client.get_object(Bucket='s3 name', Key='bertClassifier')

body_string = response['Body'].read()
bert_nn = pickle.loads(body_string)
```

This succesfully loads the BertForSequenceClassification model, but I have no way of loading BertTokenizer from this same pre trained model. Again, becuase I am not able to upload via the BertTokenizer.from_pretrained("s3 name") function. 

Is there a work around for this?






Hi Ben,

Unless I misunderstand what you're trying to do, this is not really what `save_pretrained()` and `from_pretrained()` are made for.

`save_pretrained()` lets you save a tokenizer or a model _locally_, inside a local folder. (you can then upload those files to your own s3 bucket, or use the `transformers-cli` to upload to our bucket). 

`from_pretrained()` lets you re-spawn a model or tokenizer from either a local folder, a model shortcut (hardcoded in the library's code), or a community model identifier (which resolves to files on our S3 bucket)

Let me know if things are clearer
<|||||>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.
