v2.2.2, you can now upload/share your models directly from the
using our CLI.
See more info in the
or read the instructions below:
First, login on your machine:
$ transformers-cli login # Log in using the same credentials as huggingface.co/join
Upload your model:
$ transformers-cli upload ./path/to/pretrained_model/ # ^^ Upload folder containing weights/tokenizer/config # saved via `.save_pretrained()` $ transformers-cli upload ./config.json [--filename foobar.json] # ^^ Upload a single file # (you can optionally override its filename)
Your model will then be accessible through its identifier:
Anyone can load it from code:
tokenizer = AutoTokenizer.from_pretrained("username/model_name") model = AutoModel.from_pretrained("username/model_name")
Finally, list all your files on S3:
$ transformers-cli s3 ls # List all your S3 objects.