Ahmadzei's picture
added 3 more tables for large emb model
5fa1a76
Saving a model
To export a BertModel with TorchScript, instantiate BertModel from the BertConfig
class and then save it to disk under the filename traced_bert.pt:
thon
from transformers import BertModel, BertTokenizer, BertConfig
import torch
enc = BertTokenizer.from_pretrained("google-bert/bert-base-uncased")
Tokenizing input text
text = "[CLS] Who was Jim Henson ?