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,
......
...@@ -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,
......
...@@ -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
# -------------------- --------- ---------------------------- ------ ------------------------ # -------------------- --------- ---------------------------- ------ ------------------------
......
...@@ -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',
......
...@@ -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
...@@ -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,
) )
] ]
......
...@@ -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
......
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