File size: 538 Bytes
1a8eef3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/usr/bin/env python3
import logging
from transformers import BertModel, BertTokenizer, TFBertModel, XLMRobertaTokenizer
logging.basicConfig(level=logging.INFO, filename="log.txt")
model = BertModel.from_pretrained("../../Multilingual-MiniLM-L12-H384/")
tf_model = TFBertModel.from_pretrained("../../Multilingual-MiniLM-L12-H384/", from_pt=True)
model.save_pretrained("./")
tf_model.save_pretrained("./")
tok = XLMRobertaTokenizer.from_pretrained("../../Multilingual-MiniLM-L12-H384/sentencepiece.bpe.model")
tok.save_pretrained("./")
|