1 Star 0 Fork 129

王波/MindSpeed-MM

forked from Ascend/MindSpeed-MM 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
evaluate_vlm.py 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
import mindspeed.megatron_adaptor # noqa
from megatron.training import get_args
from megatron.training.initialize import initialize_megatron
from mindspeed_mm.configs.config import merge_mm_args
from mindspeed_mm.configs.config import mm_extra_args_provider
from mindspeed_mm.tasks.evaluation.eval_datasets import eval_dataset_dict
from mindspeed_mm.tasks.evaluation.eval_impl import eval_impl_dict, eval_pipeline_dict
from mindspeed_mm.tasks.evaluation.eval_prompt import eval_model_prompt_dict
def main():
initialize_megatron(extra_args_provider=mm_extra_args_provider)
args = get_args()
merge_mm_args(args)
args = args.mm.model
inference_pipeline_class = eval_pipeline_dict[args.evaluation_model]
eval_dataset_class = eval_dataset_dict[args.evaluation_dataset]
eval_impl_class = eval_impl_dict[args.evaluation_dataset]
if args.evaluation_model in eval_model_prompt_dict:
model_prompt_build = eval_model_prompt_dict[args.evaluation_model]()
else:
model_prompt_build = None
inference_pipeline = inference_pipeline_class(args)
eval_dataset = eval_dataset_class(args.dataset_path, args.evaluation_dataset)
eval_impl = eval_impl_class(dataset=eval_dataset, inference_pipeline=inference_pipeline,
model_prompt_template=model_prompt_build, args=args)
eval_impl()
if __name__ == "__main__":
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangboroy/MindSpeed-MM.git
git@gitee.com:wangboroy/MindSpeed-MM.git
wangboroy
MindSpeed-MM
MindSpeed-MM
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385