Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # use this for BERT-base
- bert_base_config = {
- "attention_probs_dropout_prob": 0.1,
- "directionality": "bidi",
- "hidden_act": "gelu",
- "hidden_dropout_prob": 0.1,
- "hidden_size": 768,
- "initializer_range": 0.02,
- "intermediate_size": 3072,
- "max_position_embeddings": 512,
- "num_attention_heads": 12,
- "num_hidden_layers": 12,
- "pooler_fc_size": 768,
- "pooler_num_attention_heads": 12,
- "pooler_num_fc_layers": 3,
- "pooler_size_per_head": 128,
- "pooler_type": "first_token_transform",
- "type_vocab_size": 2,
- "vocab_size": VOC_SIZE
- }
- with open("{}/bert_config.json".format(MODEL_DIR), "w") as fo:
- json.dump(bert_base_config, fo, indent=2)
- with open("{}/{}".format(MODEL_DIR, VOC_FNAME), "w") as fo:
- for token in bert_vocab:
- fo.write(token+"\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement