#@title
from IPython.display import HTML
HTML('')
! pip install datasets transformers[sentencepiece]
from transformers import TFAutoModel
bert_model = TFAutoModel.from_pretrained("bert-base-cased")
print(type(bert_model))
gpt_model = TFAutoModel.from_pretrained("gpt2")
print(type(gpt_model))
bart_model = TFAutoModel.from_pretrained("facebook/bart-base")
print(type(bart_model))
from transformers import AutoConfig
bert_config = AutoConfig.from_pretrained("bert-base-cased")
print(type(bert_config))
gpt_config = AutoConfig.from_pretrained("gpt2")
print(type(gpt_config))
bart_config = AutoConfig.from_pretrained("facebook/bart-base")
print(type(bart_config))
from transformers import BertConfig
bert_config = BertConfig.from_pretrained("bert-base-cased")
print(type(bert_config))
from transformers import GPT2Config
gpt_config = GPT2Config.from_pretrained("gpt2")
print(type(gpt_config))
from transformers import BartConfig
bart_config = BartConfig.from_pretrained("facebook/bart-base")
print(type(bart_config))
from transformers import BertConfig
bert_config = BertConfig.from_pretrained("bert-base-cased")
print(bert_config)
from transformers import BertConfig, TFBertModel
bert_config = BertConfig.from_pretrained("bert-base-cased")
bert_model = TFBertModel(bert_config)
from transformers import BertConfig, TFBertModel
bert_config = BertConfig.from_pretrained("bert-base-cased")
bert_model = TFBertModel(bert_config)
# Training code
bert_model.save_pretrained("my_bert_model")