mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
Update run.py
This commit is contained in:
parent
7f2aeeff26
commit
f046d49e92
@ -6,6 +6,7 @@ from typing import List, Tuple, Union
|
||||
import tabulate
|
||||
from mmengine.config import Config
|
||||
|
||||
import opencompass
|
||||
from opencompass.datasets.custom import make_custom_dataset_config
|
||||
from opencompass.models import (VLLM, HuggingFace, HuggingFaceBaseModel,
|
||||
HuggingFaceCausalLM, HuggingFaceChatGLM3,
|
||||
@ -234,7 +235,7 @@ def change_accelerator(models, accelerator):
|
||||
for model in models:
|
||||
logger.info(f'Transforming {model["abbr"]} to {accelerator}')
|
||||
# change HuggingFace model to VLLM or LMDeploy
|
||||
if model['type'] in [HuggingFace, HuggingFaceCausalLM, HuggingFaceChatGLM3, f'{HuggingFaceBaseModel.__module__}.{HuggingFaceBaseModel.__name__}']:
|
||||
if model['type'] in [HuggingFace, HuggingFaceCausalLM, HuggingFaceChatGLM3, eval(f'{HuggingFaceBaseModel.__module__}.{HuggingFaceBaseModel.__name__}')]:
|
||||
gen_args = dict()
|
||||
if model.get('generation_kwargs') is not None:
|
||||
generation_kwargs = model['generation_kwargs'].copy()
|
||||
@ -294,7 +295,7 @@ def change_accelerator(models, accelerator):
|
||||
acc_model[item] = model[item]
|
||||
else:
|
||||
raise ValueError(f'Unsupported accelerator {accelerator} for model type {model["type"]}')
|
||||
elif model['type'] in [HuggingFacewithChatTemplate, f'{HuggingFacewithChatTemplate.__module__}.{HuggingFacewithChatTemplate.__name__}']:
|
||||
elif model['type'] in [HuggingFacewithChatTemplate, eval(f'{HuggingFacewithChatTemplate.__module__}.{HuggingFacewithChatTemplate.__name__}')]:
|
||||
if accelerator == 'vllm':
|
||||
mod = VLLMwithChatTemplate
|
||||
acc_model = dict(
|
||||
|
Loading…
Reference in New Issue
Block a user