@@ -20,14 +20,14 @@ def modify_doc_title_dir(abspath_rstfiles_dir):
20
20
del_nodes = ['Submodules' , 'Module contents' , 'Subpackages' ]
21
21
# 要删除的标题中的字符串
22
22
del_str = [' module' , ' package' ]
23
- #datasets需要的部分
23
+ # datasets需要的部分
24
24
dataset_list = ['datasets' , 'dataset' ]
25
- #需要call方法
25
+ # 需要call方法
26
26
add_call_files = [
27
27
'data.collate' , 'data.iterator' , 'data.sampler' , 'data.tokenizer' ,
28
28
'data.vocab' , 'tokenizer\_utils'
29
29
]
30
- #删除inheritance
30
+ # 删除inheritance
31
31
del_inheritance = [
32
32
'crf' , 'tcn' , 'distributed' , 'dataset' , 'paraller' , 'decoder' , 'rdrop' ,
33
33
'decoding' , 'fast\_transformer' , 'Adamoptimizer' , 'attention\_utils' ,
@@ -54,7 +54,7 @@ def modify_doc_title_dir(abspath_rstfiles_dir):
54
54
os .remove (path )
55
55
print (path )
56
56
continue
57
- #去除文档中空白页面,目前是data.iterator, embeddings.constant部分
57
+ # 去除文档中空白页面,目前是data.iterator, embeddings.constant部分
58
58
del_rst_flag = 0
59
59
for pattern in del_rst :
60
60
if pattern in first_line :
@@ -64,12 +64,12 @@ def modify_doc_title_dir(abspath_rstfiles_dir):
64
64
break
65
65
if del_rst_flag == 1 :
66
66
continue
67
- #是否加入call
67
+ # 是否加入call
68
68
add_call_files_flag = 0
69
69
for i in add_call_files :
70
70
if i in first_line :
71
71
add_call_files_flag = 1
72
- #是否删除inheritance
72
+ # 是否删除inheritance
73
73
del_inheritance_flag = 0
74
74
for j in del_inheritance :
75
75
if j in first_line :
@@ -105,7 +105,7 @@ def modify_doc_title_dir(abspath_rstfiles_dir):
105
105
if 'no-undoc-members' not in file_line :
106
106
file_line = file_line .replace ('undoc-members' ,
107
107
'no-undoc-members' )
108
- #去除datasets中多余内容
108
+ # 去除datasets中多余内容
109
109
if 'paddlenlp.datasets' in file_line :
110
110
last_name = file_line .split ('.' )[- 1 ]
111
111
if last_name .strip () not in dataset_list :
0 commit comments