Last active
May 9, 2019 16:19
-
-
Save gaphex/a365bcd0e0df01e8c94fca03ae7bd4f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment