|
- # coding=utf-8
- # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
-
- """Sample Generate GPT2"""
-
- import os
-
-
- if __name__ == "__main__":
- MAIN_DIR = os.path.dirname(os.path.abspath(__file__))
- base_path = MAIN_DIR + "/dataset"
- url = 'http://192.168.242.16:7407/api' #pretrain
- log_path = MAIN_DIR+'/log/s3_v2/40b'
- os.environ['URL_VERSION'] = 'v1'
- os.environ['TOKEN_VERSION'] = 'v2'
-
- try:
- os.makedirs(log_path)
- print(f"{log_path} created successfully.")
- except OSError as error:
- print(f"WARNING: {log_path} folder already exists.")
-
- test_list = [
- 'ceval', 'mmlu',
- 'chid', 'afqmc', 'wic', 'wsc',
- 'nq', 'boolq',
- 'cmnli', 'copa', 'gsm8k', 'humaneval', 'math',
- 'c3-m', 'race', 'csl',
- 'translate',
- ]
- for task in test_list:
- if task == 'ceval':
- ############################ old prompt ##############################
- from CEval_zeroshot_ppl_old import run_predict
- run_predict(url, log_path, few_shot=False)
- from CEval_ppl import run_predict
- run_predict(url, log_path, few_shot=False)
- from CEval_single_ppl import run_predict
- run_predict(url, log_path, few_shot=False)
- from CEval_civil_ppl import run_predict
- run_predict(url, log_path, few_shot=False)
-
- ############################ new prompt ##############################
- from CEval_zeroshot_ppl import run_predict
- run_predict(url, log_path)
- from CEval_fewshot_ppl import run_predict
- run_predict(url, log_path)
- # if task == 'mmlu':
- # from mmlu_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # run_predict(url, log_path, few_shot=True)
-
- # if task == 'chid':
- # from CHID_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # # run_predict(url, log_path, few_shot=True)
- # if task == 'afqmc':
- # from afqmc_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # # run_predict(url, log_path, few_shot=True)
- # if task == 'wic':
- # from wic_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # if task == 'wsc':
- # from wsc_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- #
- #
- # if task == 'boolq':
- # from boolq_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # if task == 'nq':
- # from nq_gen import run_predict
- # run_predict(url, log_path, few_shot=False)
-
- # if task == 'cmnli':
- # from CMNLI_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # # run_predict(url, log_path, few_shot=True)
- # if task == 'copa':
- # from copa_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # if task == 'gsm8k':
- # from GSM8k_fewshot import run_predict
- # run_predict(url, log_path, few_shot=True)
- # if task == 'math':
- # from math_fewshot import run_predict
- # run_predict(url, log_path, few_shot=True)
- # if task == 'humaneval':
- # from humaneval import run_predict
- # run_predict(url, log_path, few_shot=False)
-
-
- # if task == 'c3-m':
- # from c3m_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # if task == 'race':
- # from race_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
- # if task == 'csl':
- # from CSL_ppl import run_predict
- # run_predict(url, log_path, few_shot=False)
-
-
- # if task == 'translate':
- # from translate import run_predict
- # run_predict(url, log_path, few_shot=True)
|