-
-
Save LysandreJik/ced0b008bcefbebcab8a28c99292a1eb to your computer and use it in GitHub Desktop.
Loading a model and tokenizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import (TFBertModel, BertTokenizer, | |
TFGPT2Model, GPT2Tokenizer) | |
bert_model = TFBertModel.from_pretrained("bert-base-cased") # Automatically loads the config | |
bert_tokenizer = BertTokenizer.from_pretrained("bert-base-cased") | |
gpt2_model = TFGPT2Model.from_pretrained("gpt2") # Automatically loads the config | |
gpt2_tokenizer = GPT2Tokenizer.from_pretrained("gpt2") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment