"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "1c879101d7ead36d318cc6473fd4029b9071e97a"
Unverified Commit 7505b3ca authored by Fengzhe Zhou's avatar Fengzhe Zhou Committed by GitHub
Browse files

[Feature] Add huggingface apply_chat_template (#1098)

* add TheoremQA with 5-shot

* add huggingface_above_v4_33 classes

* use num_worker partitioner in cli

* update theoremqa

* update TheoremQA

* add TheoremQA

* rename theoremqa -> TheoremQA

* update TheoremQA output path

* rewrite many model configs

* update huggingface

* further update

* refine configs

* update configs

* update configs

* add configs/eval_llama3_instruct.py

* add summarizer multi faceted

* update bbh datasets

* update configs/models/hf_llama/lmdeploy_llama3_8b_instruct.py

* rename class

* update readme

* update hf above v4.33
parent 6c711cb2
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
dict(role="HUMAN", begin='<|START_OF_TURN_TOKEN|><|USER_TOKEN|>', end='<|END_OF_TURN_TOKEN|>'),
dict(role="BOT", begin="<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>", end='<|END_OF_TURN_TOKEN|>', generate=True),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='command-r-plus-hf', abbr='command-r-plus-hf',
path="CohereForAI/c4ai-command-r-plus", path='CohereForAI/c4ai-command-r-plus',
model_kwargs=dict(device_map='auto', trust_remote_code=True), max_out_len=1024,
tokenizer_kwargs=dict(padding_side='left', truncation_side='left', trust_remote_code=True),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=8, num_procs=1), run_cfg=dict(num_gpus=8),
end_str='<|END_OF_TURN_TOKEN|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceBaseModel
models = [
dict(
type=HuggingFaceBaseModel,
abbr='dbrx-base-hf',
path='databricks/dbrx-base',
max_out_len=1024,
batch_size=8,
run_cfg=dict(num_gpus=8),
)
]
from opencompass.models import HuggingFacewithChatTemplate
from opencompass.models import HuggingFaceCausalLM
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='dbrx-instruct-hf', abbr='dbrx-instruct-hf',
path="databricks/dbrx-instruct", path='databricks/dbrx-instruct',
model_kwargs=dict( max_out_len=1024,
trust_remote_code=True,
device_map='auto',
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
use_fast=False,
trust_remote_code=True,
),
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
meta_template=_meta_template, run_cfg=dict(num_gpus=8),
run_cfg=dict(num_gpus=8, num_procs=1),
batch_padding=True,
) )
] ]
...@@ -6,7 +6,6 @@ _meta_template = dict( ...@@ -6,7 +6,6 @@ _meta_template = dict(
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=2
) )
models = [ models = [
......
...@@ -6,7 +6,6 @@ _meta_template = dict( ...@@ -6,7 +6,6 @@ _meta_template = dict(
dict(role="HUMAN", begin='### User:\n', end='\n'), dict(role="HUMAN", begin='### User:\n', end='\n'),
dict(role="BOT", begin="### Assistant:\n", generate=True), dict(role="BOT", begin="### Assistant:\n", generate=True),
], ],
eos_token_id=2
) )
models = [ models = [
......
...@@ -7,7 +7,6 @@ _meta_template = dict( ...@@ -7,7 +7,6 @@ _meta_template = dict(
dict(role="HUMAN", begin='Human: ', end='\n\n'), dict(role="HUMAN", begin='Human: ', end='\n\n'),
dict(role="BOT", begin="Assistant: <|endoftext|>", end='<|endoftext|>', generate=True), dict(role="BOT", begin="Assistant: <|endoftext|>", end='<|endoftext|>', generate=True),
], ],
eos_token_id=2
) )
models = [ models = [
......
...@@ -6,7 +6,6 @@ _meta_template = dict( ...@@ -6,7 +6,6 @@ _meta_template = dict(
dict(role="HUMAN", begin='<_user>'), dict(role="HUMAN", begin='<_user>'),
dict(role="BOT", begin="<_bot>", end='<_end>', generate=True), dict(role="BOT", begin="<_bot>", end='<_end>', generate=True),
], ],
eos_token_id=160133
) )
models = [ models = [
......
...@@ -7,7 +7,6 @@ _meta_template = dict( ...@@ -7,7 +7,6 @@ _meta_template = dict(
dict(role="HUMAN", begin='Human: ', end='\n'), dict(role="HUMAN", begin='Human: ', end='\n'),
dict(role="BOT", begin="Assistant: ", end='</s>', generate=True), dict(role="BOT", begin="Assistant: ", end='</s>', generate=True),
], ],
eos_token_id=2
) )
models = [ models = [
......
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-0.5b-hf', abbr='qwen1.5-0.5b-hf',
path="Qwen/Qwen1.5-0.5B", path='Qwen/Qwen1.5-0.5B',
tokenizer_path='Qwen/Qwen1.5-0.5B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
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),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-0.5b-chat-hf', abbr='qwen1.5-0.5b-chat-hf',
path="Qwen/Qwen1.5-0.5B-Chat", path='Qwen/Qwen1.5-0.5B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=1),
end_str='<|im_end|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-14b-hf', abbr='qwen1.5-14b-hf',
path="Qwen/Qwen1.5-14B", path='Qwen/Qwen1.5-14B',
tokenizer_path='Qwen/Qwen1.5-14B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=2, num_procs=1), run_cfg=dict(num_gpus=1),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-14b-chat-hf', abbr='qwen1.5-14b-chat-hf',
path="Qwen/Qwen1.5-14B-Chat", path='Qwen/Qwen1.5-14B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=1),
end_str='<|im_end|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-1.8b-hf', abbr='qwen1.5-1.8b-hf',
path="Qwen/Qwen1.5-1.8B", path='Qwen/Qwen1.5-1.8B',
tokenizer_path='Qwen/Qwen1.5-1.8B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
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),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-1.8b-chat-hf', abbr='qwen1.5-1.8b-chat-hf',
path="Qwen/Qwen1.5-1.8B-Chat", path='Qwen/Qwen1.5-1.8B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=1),
end_str='<|im_end|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-32b-hf', abbr='qwen1.5-32b-hf',
path="Qwen/Qwen1.5-32B", path='Qwen/Qwen1.5-32B',
tokenizer_path='Qwen/Qwen1.5-32B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=2, num_procs=1), run_cfg=dict(num_gpus=2),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-32b-chat-hf', abbr='qwen1.5-32b-chat-hf',
path="Qwen/Qwen1.5-32B-Chat", path='Qwen/Qwen1.5-32B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=2, num_procs=1), run_cfg=dict(num_gpus=2),
end_str='<|im_end|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-4b-hf', abbr='qwen1.5-4b-hf',
path="Qwen/Qwen1.5-4B", path='Qwen/Qwen1.5-4B',
tokenizer_path='Qwen/Qwen1.5-4B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
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),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-4b-chat-hf', abbr='qwen1.5-4b-chat-hf',
path="Qwen/Qwen1.5-4B-Chat", path='Qwen/Qwen1.5-4B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=1),
end_str='<|im_end|>',
batch_padding=True,
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFaceBaseModel
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFaceBaseModel,
abbr='qwen1.5-72b-hf', abbr='qwen1.5-72b-hf',
path="Qwen/Qwen1.5-72B", path='Qwen/Qwen1.5-72B',
tokenizer_path='Qwen/Qwen1.5-72B', max_out_len=1024,
model_kwargs=dict(
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
pad_token_id=151645,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=4),
) )
] ]
from opencompass.models import HuggingFaceCausalLM from opencompass.models import HuggingFacewithChatTemplate
_meta_template = dict(
round=[
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),
],
)
models = [ models = [
dict( dict(
type=HuggingFaceCausalLM, type=HuggingFacewithChatTemplate,
abbr='qwen1.5-72b-chat-hf', abbr='qwen1.5-72b-chat-hf',
path="Qwen/Qwen1.5-72B-Chat", path='Qwen/Qwen1.5-72B-Chat',
model_kwargs=dict( max_out_len=1024,
device_map='auto',
trust_remote_code=True
),
tokenizer_kwargs=dict(
padding_side='left',
truncation_side='left',
trust_remote_code=True,
use_fast=False,
),
meta_template=_meta_template,
max_out_len=100,
max_seq_len=2048,
batch_size=8, batch_size=8,
run_cfg=dict(num_gpus=4, num_procs=1), run_cfg=dict(num_gpus=4),
end_str='<|im_end|>',
batch_padding=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