Skip to content

Commit

Permalink
delete some code
Browse files Browse the repository at this point in the history
  • Loading branch information
920232796 committed May 27, 2021
1 parent be40142 commit ebebbda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions examples/bert_english_autotitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
from bert_seq2seq.utils import load_bert
from transformers import AutoTokenizer

vocab_path = "./state_dict/roberta_wwm_vocab.txt" # roberta模型字典的位置
model_name = "roberta" # 选择模型名字
model_path = "./state_dict/roberta_wwm_pytorch_model.bin" # 模型位置
model_save_path = "./state_dict/bert_english_auto_title_model.bin"
batch_size = 4
lr = 1e-5
Expand Down Expand Up @@ -81,7 +78,6 @@ def __init__(self):
## 拿到所有文件名字
self.txts = glob.glob("./corpus/pdf_full_texts/*.json")


self.idx2word = {k: v for v, k in word2idx.items()}

def __getitem__(self, i):
Expand Down Expand Up @@ -131,6 +127,7 @@ def padding(indice, max_length, pad_idx=0):

return token_ids_padded, token_type_ids_padded, target_ids_padded

# cls hello hello hello sep hello

class Trainer:
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion test/bert_english_autotitle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pandas as pd
import numpy as np
import os
import glob
import glob
import json
import time
import bert_seq2seq
Expand Down

0 comments on commit ebebbda

Please sign in to comment.