"vscode:/vscode.git/clone" did not exist on "18a81e356eef305b244db0e7c46772925a540a44"
Unverified Commit aa2dd2b5 authored by Fengzhe Zhou's avatar Fengzhe Zhou Committed by GitHub
Browse files

[Format] Add config lints (#892)

parent 3dbba119
...@@ -17,8 +17,8 @@ with read_base(): ...@@ -17,8 +17,8 @@ with read_base():
work_dir = './outputs/internlm2-chat-keyset/' work_dir = './outputs/internlm2-chat-keyset/'
_origin_datasets = sum([v for k, v in locals().items() if k.endswith("_datasets")], []) _origin_datasets = sum([v for k, v in locals().items() if k.endswith('_datasets')], [])
_origin_models = sum([v for k, v in locals().items() if k.endswith("_model")], []) _origin_models = sum([v for k, v in locals().items() if k.endswith('_model')], [])
_vanilla_datasets = [deepcopy(d) for d in _origin_datasets] _vanilla_datasets = [deepcopy(d) for d in _origin_datasets]
_vanilla_models = [] _vanilla_models = []
......
...@@ -16,5 +16,5 @@ with read_base(): ...@@ -16,5 +16,5 @@ with read_base():
work_dir = './outputs/internlm2-keyset/' work_dir = './outputs/internlm2-keyset/'
datasets = sum([v for k, v in locals().items() if k.endswith("_datasets")], []) datasets = sum([v for k, v in locals().items() if k.endswith('_datasets')], [])
models = sum([v for k, v in locals().items() if k.endswith("_model")], []) models = sum([v for k, v in locals().items() if k.endswith('_model')], [])
...@@ -49,4 +49,3 @@ internlm_chat_7b = dict( ...@@ -49,4 +49,3 @@ internlm_chat_7b = dict(
) )
models = [internlm_chat_20b] models = [internlm_chat_20b]
...@@ -29,7 +29,7 @@ models = [ ...@@ -29,7 +29,7 @@ models = [
dict( dict(
type=LmdeployTisModel, type=LmdeployTisModel,
abbr='internlm-chat-20b-lmdeploy-tis', abbr='internlm-chat-20b-lmdeploy-tis',
path="internlm/internlm-chat-20b", path='internlm/internlm-chat-20b',
tis_addr='0.0.0.0:33337', tis_addr='0.0.0.0:33337',
max_out_len=100, max_out_len=100,
max_seq_len=2048, max_seq_len=2048,
......
...@@ -29,7 +29,7 @@ models = [ ...@@ -29,7 +29,7 @@ models = [
dict( dict(
type=TurboMindTisModel, type=TurboMindTisModel,
abbr='internlm-chat-20b-turbomind', abbr='internlm-chat-20b-turbomind',
path="internlm", path='internlm',
tis_addr='0.0.0.0:33337', tis_addr='0.0.0.0:33337',
max_out_len=100, max_out_len=100,
max_seq_len=2048, max_seq_len=2048,
......
...@@ -31,7 +31,7 @@ models = [ ...@@ -31,7 +31,7 @@ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceCausalLM,
abbr='internlm2-chat-7b-hf', abbr='internlm2-chat-7b-hf',
path="internlm/internlm2-chat-7b", path='internlm/internlm2-chat-7b',
tokenizer_path='internlm/internlm2-chat-7b', tokenizer_path='internlm/internlm2-chat-7b',
model_kwargs=dict( model_kwargs=dict(
trust_remote_code=True, trust_remote_code=True,
...@@ -49,7 +49,7 @@ models = [ ...@@ -49,7 +49,7 @@ models = [
meta_template=_meta_template, meta_template=_meta_template,
run_cfg=dict(num_gpus=1, num_procs=1), run_cfg=dict(num_gpus=1, num_procs=1),
end_str='<|im_end|>', end_str='<|im_end|>',
generation_kwargs = {"eos_token_id": [2, 92542], "do_sample": True}, generation_kwargs = {'eos_token_id': [2, 92542], 'do_sample': True},
batch_padding=True, batch_padding=True,
) )
] ]
...@@ -91,7 +91,7 @@ judge_models = [ ...@@ -91,7 +91,7 @@ judge_models = [
use_fast=False, use_fast=False,
trust_remote_code=True, trust_remote_code=True,
), ),
generation_kwargs = {"do_sample": True}, generation_kwargs = {'do_sample': True},
max_out_len=512, max_out_len=512,
max_seq_len=4096, max_seq_len=4096,
batch_size=8, batch_size=8,
...@@ -122,4 +122,4 @@ summarizer = dict( ...@@ -122,4 +122,4 @@ summarizer = dict(
type=FlamesSummarizer, judge_type = 'general' type=FlamesSummarizer, judge_type = 'general'
) )
work_dir = 'outputs/flames/' work_dir = 'outputs/flames/'
\ No newline at end of file
...@@ -35,4 +35,3 @@ internlm_chat_7b = dict( ...@@ -35,4 +35,3 @@ internlm_chat_7b = dict(
) )
models = [internlm_chat_20b] models = [internlm_chat_20b]
...@@ -19,7 +19,7 @@ datasets = sum((v for k, v in locals().items() if k.endswith('_datasets')), []) ...@@ -19,7 +19,7 @@ datasets = sum((v for k, v in locals().items() if k.endswith('_datasets')), [])
internlm_7b = dict( internlm_7b = dict(
type=TurboMindModel, type=TurboMindModel,
abbr='internlm-7b-turbomind', abbr='internlm-7b-turbomind',
path="internlm/internlm-7b", path='internlm/internlm-7b',
engine_config=dict(session_len=2048, engine_config=dict(session_len=2048,
max_batch_size=32, max_batch_size=32,
rope_scaling_factor=1.0), rope_scaling_factor=1.0),
...@@ -38,7 +38,7 @@ internlm_7b = dict( ...@@ -38,7 +38,7 @@ internlm_7b = dict(
internlm_20b = dict( internlm_20b = dict(
type=TurboMindModel, type=TurboMindModel,
abbr='internlm-20b-turbomind', abbr='internlm-20b-turbomind',
path="internlm/internlm-20b", path='internlm/internlm-20b',
engine_config=dict(session_len=2048, engine_config=dict(session_len=2048,
max_batch_size=8, max_batch_size=8,
rope_scaling_factor=1.0), rope_scaling_factor=1.0),
......
...@@ -18,7 +18,7 @@ models = [ ...@@ -18,7 +18,7 @@ models = [
dict( dict(
type=TurboMindTisModel, type=TurboMindTisModel,
abbr='internlm-chat-20b-turbomind', abbr='internlm-chat-20b-turbomind',
path="internlm", path='internlm',
tis_addr='0.0.0.0:33337', tis_addr='0.0.0.0:33337',
max_out_len=100, max_out_len=100,
max_seq_len=2048, max_seq_len=2048,
......
...@@ -5,4 +5,4 @@ with read_base(): ...@@ -5,4 +5,4 @@ with read_base():
from .models.llama.llama2_7b import models from .models.llama.llama2_7b import models
datasets = [*piqa_datasets, *siqa_datasets] datasets = [*piqa_datasets, *siqa_datasets]
\ No newline at end of file
...@@ -6,11 +6,11 @@ with read_base(): ...@@ -6,11 +6,11 @@ with read_base():
from .summarizers.lveval import summarizer from .summarizers.lveval import summarizer
models[0][ models[0][
"path" 'path'
] = "/path/to/your/huggingface_models/Llama-2-7b-chat-hf" ] = '/path/to/your/huggingface_models/Llama-2-7b-chat-hf'
models[0][ models[0][
"tokenizer_path" 'tokenizer_path'
] = "/path/to/your/huggingface_models/Llama-2-7b-chat-hf" ] = '/path/to/your/huggingface_models/Llama-2-7b-chat-hf'
models[0]["max_seq_len"] = 4096 models[0]['max_seq_len'] = 4096
models[0]["generation_kwargs"] = dict(do_sample=False) models[0]['generation_kwargs'] = dict(do_sample=False)
models[0]["mode"] = "mid" # truncate in the middle models[0]['mode'] = 'mid' # truncate in the middle
...@@ -10,7 +10,7 @@ with read_base(): ...@@ -10,7 +10,7 @@ with read_base():
work_dir = 'outputs/debug/llama3-instruct' work_dir = 'outputs/debug/llama3-instruct'
models = sum([v for k, v in locals().items() if k.endswith("_model")], []) models = sum([v for k, v in locals().items() if k.endswith('_model')], [])
# dataset version metric mode llama-3-8b-instruct-hf # dataset version metric mode llama-3-8b-instruct-hf
# -------------------- --------- ---------------------------- ------ ------------------------ # -------------------- --------- ---------------------------- ------ ------------------------
......
...@@ -41,7 +41,7 @@ for mdl in models: ...@@ -41,7 +41,7 @@ for mdl in models:
infer = dict( infer = dict(
# The OpenCompass implementation of BPC currently only supports NaivePartitioner, as the sliding window approach requires the dataset to be loaded sequentially. Using other partitioner types may produce incorrect results. # The OpenCompass implementation of BPC currently only supports NaivePartitioner, as the sliding window approach requires the dataset to be loaded sequentially. Using other partitioner types may produce incorrect results.
partitioner=dict(type=NaivePartitioner), partitioner=dict(type=NaivePartitioner),
runner=dict( runner=dict(
type=LocalRunner, type=LocalRunner,
task=dict(type=OpenICLInferTask), task=dict(type=OpenICLInferTask),
......
...@@ -68,7 +68,7 @@ Examples: ...@@ -68,7 +68,7 @@ Examples:
(give benefit of the doubt to units) (give benefit of the doubt to units)
Expression 1: 64 Expression 1: 64
Expression 2: Expression 2:
[No] [No]
(only mark as equivalent if both expressions are nonempty) (only mark as equivalent if both expressions are nonempty)
...@@ -80,7 +80,7 @@ YOUR TASK ...@@ -80,7 +80,7 @@ YOUR TASK
Respond with only "[Yes]" or "[No]" (without quotes). Do not include a rationale. Respond with only "[Yes]" or "[No]" (without quotes). Do not include a rationale.
Expression 1: {obj_gold} Expression 1: {obj_gold}
Expression 2: {prediction} Expression 2: {prediction}
""" """
...@@ -99,7 +99,7 @@ for d in eng_datasets: ...@@ -99,7 +99,7 @@ for d in eng_datasets:
d['eval_cfg']= dict( d['eval_cfg']= dict(
evaluator=dict( evaluator=dict(
type=LMEvaluator, type=LMEvaluator,
# If you need to preprocess the prediction before judging, # If you need to preprocess the prediction before judging,
# you can specify the pred_postprocessor function here # you can specify the pred_postprocessor function here
pred_postprocessor=dict(type=math_judement_preprocess), pred_postprocessor=dict(type=math_judement_preprocess),
prompt_template=dict( prompt_template=dict(
...@@ -112,7 +112,7 @@ for d in eng_datasets: ...@@ -112,7 +112,7 @@ for d in eng_datasets:
]), ]),
), ),
), ),
pred_role="BOT", pred_role='BOT',
) )
infer = dict( infer = dict(
......
...@@ -18,7 +18,7 @@ models=[ ...@@ -18,7 +18,7 @@ models=[
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceCausalLM,
abbr='internlm-chat-7b-hf', abbr='internlm-chat-7b-hf',
path="internlm/internlm-chat-7b", path='internlm/internlm-chat-7b',
tokenizer_path='internlm/internlm-chat-7b', tokenizer_path='internlm/internlm-chat-7b',
tokenizer_kwargs=dict( tokenizer_kwargs=dict(
padding_side='left', padding_side='left',
...@@ -45,4 +45,4 @@ summarizer = dict( ...@@ -45,4 +45,4 @@ summarizer = dict(
{'name': 'winogrande', 'subsets': _winogrande_all}, {'name': 'winogrande', 'subsets': _winogrande_all},
{'name': 'winogrande_std', 'subsets': _winogrande_all, 'std': True}, {'name': 'winogrande_std', 'subsets': _winogrande_all, 'std': True},
] ]
) )
\ No newline at end of file
...@@ -8,4 +8,4 @@ with read_base(): ...@@ -8,4 +8,4 @@ with read_base():
datasets = lawbench_zero_shot_datasets + lawbench_one_shot_datasets datasets = lawbench_zero_shot_datasets + lawbench_one_shot_datasets
for d in datasets: for d in datasets:
d["infer_cfg"]["inferencer"]["save_every"] = 1 d['infer_cfg']['inferencer']['save_every'] = 1
...@@ -90,7 +90,7 @@ judge_models = [dict( ...@@ -90,7 +90,7 @@ judge_models = [dict(
## ------------- Evaluation Configuration ## ------------- Evaluation Configuration
eval = dict( eval = dict(
partitioner=dict( partitioner=dict(
type=SubjectiveSizePartitioner, max_task_size=1000, mode='m2n', base_models=[gpt4], compare_models=models, type=SubjectiveSizePartitioner, max_task_size=1000, mode='m2n', base_models=[gpt4], compare_models=models,
infer_order='random', infer_order='random',
judge_models=judge_models judge_models=judge_models
), ),
...@@ -101,4 +101,4 @@ work_dir = 'outputs/alpaca/' ...@@ -101,4 +101,4 @@ work_dir = 'outputs/alpaca/'
summarizer = dict(type=AlpacaSummarizer, judge_type='v2') summarizer = dict(type=AlpacaSummarizer, judge_type='v2')
\ No newline at end of file
...@@ -60,7 +60,7 @@ gpt4_judge = dict( ...@@ -60,7 +60,7 @@ gpt4_judge = dict(
abbr='GPT4-Turbo', abbr='GPT4-Turbo',
path='gpt-4-1106-preview', path='gpt-4-1106-preview',
key='', # The key will be obtained from $OPENAI_API_KEY, but you can write down your key here as well key='', # The key will be obtained from $OPENAI_API_KEY, but you can write down your key here as well
config='weighted_alpaca_eval_gpt4_turbo' config='weighted_alpaca_eval_gpt4_turbo'
) )
## ------------- Evaluation Configuration ## ------------- Evaluation Configuration
eval = dict( eval = dict(
......
...@@ -25,20 +25,20 @@ api_meta_template = dict( ...@@ -25,20 +25,20 @@ api_meta_template = dict(
_meta_template = dict( _meta_template = dict(
round=[ round=[
dict(role="HUMAN", begin="<|begin_of_text|>user<|end_header_id|>\n\n", end="<|eot_id|>"), dict(role='HUMAN', begin='<|begin_of_text|>user<|end_header_id|>\n\n', end='<|eot_id|>'),
dict(role="BOT", begin="<|begin_of_text|>assistant<|end_header_id|>\n\n", end="<|eot_id|>", generate=True), dict(role='BOT', begin='<|begin_of_text|>assistant<|end_header_id|>\n\n', end='<|eot_id|>', generate=True),
], ],
) )
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceCausalLM,
abbr="llama-3-8b-instruct-hf", abbr='llama-3-8b-instruct-hf',
path="meta-llama/Meta-Llama-3-8B-Instruct", path='meta-llama/Meta-Llama-3-8B-Instruct',
model_kwargs=dict(device_map="auto"), model_kwargs=dict(device_map='auto'),
tokenizer_kwargs=dict( tokenizer_kwargs=dict(
padding_side="left", padding_side='left',
truncation_side="left", truncation_side='left',
use_fast=False, use_fast=False,
), ),
meta_template=_meta_template, meta_template=_meta_template,
...@@ -46,7 +46,7 @@ models = [ ...@@ -46,7 +46,7 @@ models = [
max_seq_len=2048, max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=1, num_procs=1), run_cfg=dict(num_gpus=1, num_procs=1),
generation_kwargs={"eos_token_id": [128001, 128009]}, generation_kwargs={'eos_token_id': [128001, 128009]},
batch_padding=True, batch_padding=True,
) )
] ]
...@@ -69,7 +69,7 @@ judge_models = [dict( ...@@ -69,7 +69,7 @@ judge_models = [dict(
abbr='GPT4-Turbo', abbr='GPT4-Turbo',
type=OpenAI, type=OpenAI,
path='gpt-4-1106-preview', path='gpt-4-1106-preview',
key='', key='',
meta_template=api_meta_template, meta_template=api_meta_template,
query_per_second=1, query_per_second=1,
max_out_len=1024, max_out_len=1024,
...@@ -101,4 +101,4 @@ eval = dict( ...@@ -101,4 +101,4 @@ eval = dict(
summarizer = dict( summarizer = dict(
type=ArenaHardSummarizer type=ArenaHardSummarizer
) )
\ No newline at end of file
...@@ -25,8 +25,8 @@ api_meta_template = dict( ...@@ -25,8 +25,8 @@ api_meta_template = dict(
_meta_template = dict( _meta_template = dict(
round=[ round=[
dict(role="HUMAN", begin='<|im_start|>user\n', end='<|im_end|>\n'), dict(role='HUMAN', begin='<|im_start|>user\n', end='<|im_end|>\n'),
dict(role="BOT", begin="<|im_start|>assistant\n", end='<|im_end|>\n', generate=True), dict(role='BOT', begin='<|im_start|>assistant\n', end='<|im_end|>\n', generate=True),
], ],
eos_token_id=151645, eos_token_id=151645,
) )
...@@ -35,7 +35,7 @@ models = [ ...@@ -35,7 +35,7 @@ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceCausalLM,
abbr='qwen1.5-7b-chat-hf', abbr='qwen1.5-7b-chat-hf',
path="Qwen/Qwen1.5-7B-Chat", path='Qwen/Qwen1.5-7B-Chat',
model_kwargs=dict( model_kwargs=dict(
device_map='auto', device_map='auto',
trust_remote_code=True trust_remote_code=True
...@@ -79,7 +79,7 @@ judge_models = [dict( ...@@ -79,7 +79,7 @@ judge_models = [dict(
abbr='GPT4-Turbo', abbr='GPT4-Turbo',
type=OpenAI, type=OpenAI,
path='gpt-4-1106-preview', path='gpt-4-1106-preview',
key='', key='',
meta_template=api_meta_template, meta_template=api_meta_template,
query_per_second=1, query_per_second=1,
max_out_len=1024, max_out_len=1024,
...@@ -108,4 +108,4 @@ eval = dict( ...@@ -108,4 +108,4 @@ eval = dict(
summarizer = dict( summarizer = dict(
type=MultiroundSummarizer type=MultiroundSummarizer
) )
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment