Open namai-dev opened 1 year ago
why is it cant work
import tensorflow as tf from transformers import BertTokenizer, TFBertForSequenceClassification
bert_base_dir = "/path/to/bert/uncased_L-12_H-768_A-12" model_path = bert_base_dir + "/bert_model.ckpt" config_path = bert_base_dir + "/bert_config.json" vocab_path = bert_base_dir + "/vocab.txt"
tokenizer = BertTokenizer.from_pretrained(vocab_path)
model = TFBertForSequenceClassification.from_pretrained( config_path, num_labels=2, from_pt=True )
why is it cant work
import tensorflow as tf from transformers import BertTokenizer, TFBertForSequenceClassification
bert_base_dir = "/path/to/bert/uncased_L-12_H-768_A-12" model_path = bert_base_dir + "/bert_model.ckpt" config_path = bert_base_dir + "/bert_config.json" vocab_path = bert_base_dir + "/vocab.txt"
tokenizer = BertTokenizer.from_pretrained(vocab_path)
model = TFBertForSequenceClassification.from_pretrained( config_path, num_labels=2,
from_pt=True )