Content-Length: 233978 | pFad | http://github.com/open-compass/opencompass/commit/f046d49e92091b81dbd618485aa5fe4d553276fd

DE Update run.py · open-compass/opencompass@f046d49 · GitHub
Skip to content

Commit

Permalink
Update run.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzefeng92 authored Jan 14, 2025
1 parent 7f2aeef commit f046d49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions opencompass/utils/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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,
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f046d49

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/open-compass/opencompass/commit/f046d49e92091b81dbd618485aa5fe4d553276fd

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy