Save and load models | TensorFlow Core PyTorch-Transformers (formerly known as pytorch-pretrained-bert) is a library of state-of-the-art pre-trained models for Natural Language Processing (NLP). Save and load Keras models | TensorFlow Core Drag-and-drop your files to the Hub with the web interface. Use Hugging Face with Amazon SageMaker Q&A, QnA, Bert, Huggingface, Transformers, NLU, NLP ... - ABCOM Education !transformers-cli login !git config --global user.email "youremail" !git config --global user.name "yourname" !sudo apt-get install git-lfs %cd your_model_output_dir !git add . Save your neuron model to disk and avoid recompilation.ΒΆ To avoid recompiling the model before every deployment, you can save the neuron model by calling model_neuron.save(model_dir). There are already tutorials on how to fine-tune GPT-2. Fine-Tuning Hugging Face Model with Custom Dataset - Medium To save your time, I will just provide you the code which can be used to train and predict your model with Trainer API. config = AutoConfig.from_pretrained ("./saved/checkpoint-480000") model = RobertaForMaskedLM (config=config) To load a pipeline from a data directory, you can use spacy.load () with the local path. I have got tf model for DistillBERT by the following python line. Be sure to call model.to(torch.device('cuda')) to convert the model's parameter tensors to CUDA tensors. To save a model is the essential step, it takes time to run model fine-tuning and you should save the result when training completes. The size of the batches depend s on available memory. Data was collected between 15-20th June 2021. Run inference with a pre-trained HuggingFace model: You can use one of the thousands of pre-trained Hugging Face models to run your inference jobs with no additional training needed.