".github/vscode:/vscode.git/clone" did not exist on "716286f19ddd9eb417113e064b538706884c8e73"
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 ...@@ -5,8 +5,8 @@ import tabulate
from mmengine.config import Config from mmengine.config import Config
from opencompass.datasets.custom import make_custom_dataset_config from opencompass.datasets.custom import make_custom_dataset_config
from opencompass.models import (VLLM, HuggingFaceBaseModel, from opencompass.models import (VLLM, HuggingFace, HuggingFaceBaseModel,
HuggingFaceCausalLM, HuggingFaceCausalLM, HuggingFaceChatGLM3,
HuggingFacewithChatTemplate, TurboMindModel) HuggingFacewithChatTemplate, TurboMindModel)
from opencompass.partitioners import NaivePartitioner, NumWorkerPartitioner from opencompass.partitioners import NaivePartitioner, NumWorkerPartitioner
from opencompass.runners import DLCRunner, LocalRunner, SlurmRunner from opencompass.runners import DLCRunner, LocalRunner, SlurmRunner
...@@ -200,7 +200,9 @@ def change_accelerator(models, accelerator): ...@@ -200,7 +200,9 @@ def change_accelerator(models, accelerator):
for model in models: for model in models:
logger.info(f'Transforming {model["abbr"]} to {accelerator}') logger.info(f'Transforming {model["abbr"]} to {accelerator}')
# change HuggingFace model to VLLM or TurboMindModel # change HuggingFace model to VLLM or TurboMindModel
if model['type'] is HuggingFaceCausalLM: if model['type'] in [
HuggingFace, HuggingFaceCausalLM, HuggingFaceChatGLM3
]:
gen_args = dict() gen_args = dict()
if model.get('generation_kwargs') is not None: if model.get('generation_kwargs') is not None:
generation_kwargs = model['generation_kwargs'].copy() generation_kwargs = model['generation_kwargs'].copy()
...@@ -267,6 +269,8 @@ def change_accelerator(models, accelerator): ...@@ -267,6 +269,8 @@ def change_accelerator(models, accelerator):
acc_model[item] = model[item] acc_model[item] = model[item]
else: else:
raise ValueError(f'Unsupported accelerator {accelerator}') raise ValueError(f'Unsupported accelerator {accelerator}')
else:
raise ValueError(f'Unsupported model type {model["type"]}')
model_accels.append(acc_model) model_accels.append(acc_model)
return model_accels 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