paddlenlp
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 """
15import io16import os17
18
19def get_model_list():20"""21get model list from
22<https://github.com/PaddlePaddle/PaddleNLP/model_zoo/>
23<https://github.com/PaddlePaddle/PaddleNLP/examples/>
24"""
25
26CI_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]110examples_second_list = ["model_interpretation", "semantic_indexing", "lexical_analysis", "word_embedding"]111
112model_list = os.listdir("model_zoo")113examples_list = os.listdir("examples/")114app_list = os.listdir("applications/")115
116# remove model_list README117model_list.remove("README.md")118examples_list.remove("README.md")119model_list.extend(app_list)120model_list.extend(examples_second_list)121for examples_model_list in examples_list:122if examples_model_list not in examples_second_list:123examples_model = os.listdir("examples/" + examples_model_list)124if "README.md" in examples_model:125examples_model.remove("README.md")126model_list.extend(examples_model)127
128all_examples_dict = set(sorted(model_list))129no_test_models = []130
131# get model list not in CI/CE132for full_model in all_examples_dict:133if full_model not in CI_MODEL_LIST:134no_test_models.append(full_model)135
136# save model list for CI run_ci.sh137with io.open("./scripts/regression/model_list.txt", "w", encoding="utf-8") as list:138for all_model in all_examples_dict:139list.write("{}\n".format(all_model))140list.close()141return all_examples_dict142
143
144if __name__ == "__main__":145get_model_list()146