ohmeow / blurr

A library that integrates huggingface transformers with the world of fastai, giving fastai devs everything they need to train, evaluate, and deploy transformer specific models.
https://ohmeow.github.io/blurr
Apache License 2.0
289 stars 34 forks source link

How to save and load the pretrained model to local? #81

Open nithinreddyy opened 2 years ago

nithinreddyy commented 2 years ago

I'm working on the text summarization task. How to save and load the pretrained model instead of downloading again and again on google colab/local pc?

Below is the code i'm working on

pretrained_model_name = "facebook/bart-large-cnn"
hf_arch, hf_config, hf_tokenizer, hf_model = get_hf_objects(pretrained_model_name, model_cls=BartForConditionalGeneration)

hf_arch, type(hf_config), type(hf_tokenizer), type(hf_model)