Update main.py
Browse files
main.py
CHANGED
@@ -69,7 +69,7 @@ def create_logger(args):
|
|
69 |
class Word_BERT(nn.Module):
|
70 |
def __init__(self, seq_label=1,cancer_label=8,transfer_label=2,ly_transfer=2):
|
71 |
super(Word_BERT, self).__init__()
|
72 |
-
self.bert = BertModel.from_pretrained('/app
|
73 |
# self.bert_config = self.bert.config
|
74 |
self.out = nn.Sequential(
|
75 |
# nn.Linear(768,256),
|
@@ -166,7 +166,7 @@ def model_init():
|
|
166 |
acuda = torch.cuda.is_available() and not args.no_cuda
|
167 |
device = 'cuda' if acuda else 'cpu'
|
168 |
os.environ["CUDA_VISIBLE_DEVICES"] = device
|
169 |
-
tokenizer = BertTokenizerFast(vocab_file='/app
|
170 |
# # tokenizer = BertTokenizer(vocab_file=args.voca_path)
|
171 |
model = Word_BERT()
|
172 |
# # model = model.load_state_dict(torch.load(args.model_path))
|
|
|
69 |
class Word_BERT(nn.Module):
|
70 |
def __init__(self, seq_label=1,cancer_label=8,transfer_label=2,ly_transfer=2):
|
71 |
super(Word_BERT, self).__init__()
|
72 |
+
self.bert = BertModel.from_pretrained('/home/user/app/./bert-base-zh')
|
73 |
# self.bert_config = self.bert.config
|
74 |
self.out = nn.Sequential(
|
75 |
# nn.Linear(768,256),
|
|
|
166 |
acuda = torch.cuda.is_available() and not args.no_cuda
|
167 |
device = 'cuda' if acuda else 'cpu'
|
168 |
os.environ["CUDA_VISIBLE_DEVICES"] = device
|
169 |
+
tokenizer = BertTokenizerFast(vocab_file='/home/user/app/./bert-base-zh/vocab.txt', sep_token="[SEP]", pad_token="[PAD]", cls_token="[CLS]")
|
170 |
# # tokenizer = BertTokenizer(vocab_file=args.voca_path)
|
171 |
model = Word_BERT()
|
172 |
# # model = model.load_state_dict(torch.load(args.model_path))
|