paddlenlp

Форк
0
/
get_model_list.py 
145 строк · 3.8 Кб
1
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
"""Get PaddleNLP develop model list && before merge pr """
15
import io
16
import os
17

18

19
def get_model_list():
20
    """
21
    get model list from
22
    <https://github.com/PaddlePaddle/PaddleNLP/model_zoo/>
23
    <https://github.com/PaddlePaddle/PaddleNLP/examples/>
24
    """
25

26
    CI_MODEL_LIST = [
27
        "waybill_ie",
28
        "msra_ner",
29
        "glue",
30
        "bert",
31
        "skep",
32
        "bigbird",
33
        "electra",
34
        "gpt",
35
        "ernie",
36
        "xlnet",
37
        "ofa",
38
        "albert",
39
        "squad",
40
        "tinybert",
41
        "lexical_analysis",
42
        "seq2seq",
43
        "pretrained_models",
44
        "word_embedding",
45
        "ernie-ctm",
46
        "distilbert",
47
        "stacl",
48
        "transformer",
49
        "simbert",
50
        "ernie-doc",
51
        "transformer-xl",
52
        "ernie-m",
53
        "plato-xl",
54
        "pointer_summarizer",
55
        "question_matching",
56
        "few_shot",
57
        "unimo-text",
58
        "ernie-csc",
59
        "nptag",
60
        "ofa",
61
        "transformer",
62
        "DuIE",
63
        "tcn",
64
        "word_embedding",
65
        "unified_transformer",
66
        "lic2021_baseline",
67
        "vae-seq2seq",
68
        "msra_ner",
69
        "simbert",
70
        "clue",
71
        "pet",
72
        "bert",
73
        "ernie-ctm",
74
        "DuReader-yesno",
75
        "nptag",
76
        "semantic_indexing",
77
        "seq2seq",
78
        "pointer_summarizer",
79
        "bigbird",
80
        "unimo-text",
81
        "minilmv2",
82
        "wordtag",
83
        "simcse",
84
        "ernie-gen",
85
        "distill_lstm",
86
        "DuReader-robust",
87
        "ernie_matching",
88
        "rnn",
89
        "ernie-1.0",
90
        "stacl",
91
        "erniesage",
92
        "DuEE",
93
        "efl",
94
        "doc",
95
        "couplet",
96
        "rnnlm",
97
        "pp-minilm",
98
        "dgu",
99
        "mpnet",
100
        "textcnn",
101
        "p-tuning",
102
        "SQuAD",
103
        "elmo",
104
        "plato-2",
105
        "pretrained_models",
106
        "sentiment_analysis",
107
        "ernie-health",
108
        "gpt-3",
109
    ]
110
    examples_second_list = ["model_interpretation", "semantic_indexing", "lexical_analysis", "word_embedding"]
111

112
    model_list = os.listdir("model_zoo")
113
    examples_list = os.listdir("examples/")
114
    app_list = os.listdir("applications/")
115

116
    # remove model_list README
117
    model_list.remove("README.md")
118
    examples_list.remove("README.md")
119
    model_list.extend(app_list)
120
    model_list.extend(examples_second_list)
121
    for examples_model_list in examples_list:
122
        if examples_model_list not in examples_second_list:
123
            examples_model = os.listdir("examples/" + examples_model_list)
124
            if "README.md" in examples_model:
125
                examples_model.remove("README.md")
126
            model_list.extend(examples_model)
127

128
    all_examples_dict = set(sorted(model_list))
129
    no_test_models = []
130

131
    # get model list not in CI/CE
132
    for full_model in all_examples_dict:
133
        if full_model not in CI_MODEL_LIST:
134
            no_test_models.append(full_model)
135

136
    # save model list for CI run_ci.sh
137
    with io.open("./scripts/regression/model_list.txt", "w", encoding="utf-8") as list:
138
        for all_model in all_examples_dict:
139
            list.write("{}\n".format(all_model))
140
        list.close()
141
    return all_examples_dict
142

143

144
if __name__ == "__main__":
145
    get_model_list()
146

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.