"...git@developer.sourcefind.cn:OpenDAS/mmdetection3d.git" did not exist on "cde515d5157fbff427bd5849335f473c8066a394"
Unverified Commit e3c0448b authored by liushz's avatar liushz Committed by GitHub
Browse files

Update accelerator (#1152)



* Update acclerator

* update run

---------
Co-authored-by: default avatarliuhongwei <liuhongwei@pjlab.org.cn>
Co-authored-by: default avatarFengzhe Zhou <zfz-960727@163.com>
parent f10dd48f
......@@ -5,8 +5,8 @@ import tabulate
from mmengine.config import Config
from opencompass.datasets.custom import make_custom_dataset_config
from opencompass.models import (VLLM, HuggingFaceBaseModel,
HuggingFaceCausalLM,
from opencompass.models import (VLLM, HuggingFace, HuggingFaceBaseModel,
HuggingFaceCausalLM, HuggingFaceChatGLM3,
HuggingFacewithChatTemplate, TurboMindModel)
from opencompass.partitioners import NaivePartitioner, NumWorkerPartitioner
from opencompass.runners import DLCRunner, LocalRunner, SlurmRunner
......@@ -200,7 +200,9 @@ def change_accelerator(models, accelerator):
for model in models:
logger.info(f'Transforming {model["abbr"]} to {accelerator}')
# change HuggingFace model to VLLM or TurboMindModel
if model['type'] is HuggingFaceCausalLM:
if model['type'] in [
HuggingFace, HuggingFaceCausalLM, HuggingFaceChatGLM3
]:
gen_args = dict()
if model.get('generation_kwargs') is not None:
generation_kwargs = model['generation_kwargs'].copy()
......@@ -267,6 +269,8 @@ def change_accelerator(models, accelerator):
acc_model[item] = model[item]
else:
raise ValueError(f'Unsupported accelerator {accelerator}')
else:
raise ValueError(f'Unsupported model type {model["type"]}')
model_accels.append(acc_model)
return model_accels
......
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