lightningdot
copied
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions
12 lines
333 B
12 lines
333 B
"""
|
|
Download and extract PyTorch pretrained BERT model
|
|
python scripts/download_bert.py bert-base-cased /pretrain/bert-base-cased.pt
|
|
"""
|
|
import sys
|
|
|
|
import torch
|
|
from pytorch_pretrained_bert import BertForPreTraining
|
|
|
|
bert, output = sys.argv[1:]
|
|
model = BertForPreTraining.from_pretrained(bert)
|
|
torch.save(model.state_dict(), output)
|