Repository: open-compass/opencompass
Issue: internlm2-7B-base CMMLU评测结果异常
Root cause: Configuration Error

### 先决条件

- [X] 我已经搜索过 [问题](https://github.com/open-compass/opencompass/issues/) 和 [讨论](https://github.com/open-compass/opencompass/discussions) 但未得到预期的帮助。
- [X] 错误在 [最新版本](https://github.com/open-compass/opencompass) 中尚未被修复。

### 问题类型

我正在使用官方支持的任务/模型/数据集进行评估。

### 环境

{'CUDA available': True,
 'CUDA_HOME': '/usr/local/cuda',
 'GCC': 'gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0',
 'GPU 0': 'NVIDIA A100-SXM4-80GB',
 'MMEngine': '0.10.4',
 'MUSA available': False,
 'NVCC': 'Cuda compilation tools, release 11.8, V11.8.89',
 'OpenCV': '4.10.0',
 'PyTorch': '2.1.0+cu118',
 'PyTorch compiling details': 'PyTorch built with:\n'
                              '  - GCC 9.3\n'
                              '  - C++ Version: 201703\n'
                              '  - Intel(R) oneAPI Math Kernel Library Version '
                              '2022.2-Product Build 20220804 for Intel(R) 64 '
                              'architecture applications\n'
                              '  - Intel(R) MKL-DNN v3.1.1 (Git Hash '
                              '64f6bcbcbab628e96f33a62c3e975f8535a7bde4)\n'
                              '  - OpenMP 201511 (a.k.a. OpenMP 4.5)\n'
                              '  - LAPACK is enabled (usually provided by '
                              'MKL)\n'
                              '  - NNPACK is enabled\n'
                              '  - CPU capability usage: AVX512\n'
                              '  - CUDA Runtime 11.8\n'
                              '  - NVCC architecture flags: '
                              '-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_90,code=sm_90\n'
                              '  - CuDNN 8.7\n'
                              '  - Magma 2.6.1\n'
                              '  - Build settings: BLAS_INFO=mkl, '
                              'BUILD_TYPE=Release, CUDA_VERSION=11.8, '
                              'CUDNN_VERSION=8.7.0, '
                              'CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, '
                              'CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 '
                              '-fabi-version=11 -fvisibility-inlines-hidden '
                              '-DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO '
                              '-DLIBKINETO_NOROCTRACER -DUSE_FBGEMM '
                              '-DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK '
                              '-DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE '
                              '-O2 -fPIC -Wall -Wextra -Werror=return-type '
                              '-Werror=non-virtual-dtor -Werror=bool-operation '
                              '-Wnarrowing -Wno-missing-field-initializers '
                              '-Wno-type-limits -Wno-array-bounds '
                              '-Wno-unknown-pragmas -Wno-unused-parameter '
                              '-Wno-unused-function -Wno-unused-result '
                              '-Wno-strict-overflow -Wno-strict-aliasing '
                              '-Wno-stringop-overflow -Wno-psabi '
                              '-Wno-error=pedantic -Wno-error=old-style-cast '
                              '-Wno-invalid-partial-specialization '
                              '-Wno-unused-private-field '
                              '-Wno-aligned-allocation-unavailable '
                              '-Wno-missing-braces -fdiagnostics-color=always '
                              '-faligned-new -Wno-unused-but-set-variable '
                              '-Wno-maybe-uninitialized -fno-math-errno '
                              '-fno-trapping-math -Werror=format '
                              '-Werror=cast-function-type '
                              '-Wno-stringop-overflow, LAPACK_INFO=mkl, '
                              'PERF_WITH_AVX=1, PERF_WITH_AVX2=1, '
                              'PERF_WITH_AVX512=1, '
                              'TORCH_DISABLE_GPU_ASSERTS=ON, '
                              'TORCH_VERSION=2.1.0, USE_CUDA=ON, USE_CUDNN=ON, '
                              'USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, '
                              'USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, '
                              'USE_MPI=OFF, USE_NCCL=1, USE_NNPACK=ON, '
                              'USE_OPENMP=ON, USE_ROCM=OFF, \n',
 'Python': '3.9.19 (main, Mar 21 2024, 17:11:28) [GCC 11.2.0]',
 'TorchVision': '0.16.0+cu118',
 'numpy_random_seed': 2147483648,
 'opencompass': '0.2.5+a32f21a',
 'sys.platform': 'linux'}

### 重现问题 - 代码/配置示例

python run.py --models  lmdeploy_internlm2_base_7b  --datasets cmmlu_gen

配置文件
from opencompass.models import TurboMindModel
models = [
    dict(
        type=TurboMindModel,
        abbr='internlm2-base-7b-turbomind',
        path='/mnt/afs/models/internlm2-7B',
        engine_config=dict(session_len=7168, max_batch_size=32, tp=1),
        gen_config=dict(top_k=1, temperature=1e-6, top_p=0.9, max_new_tokens=128),
        max_seq_len=7168,
        max_out_len=128,
        batch_size=32,
        run_cfg=dict(num_gpus=1),
    )
]
summary txt内容
dataset,version,metric,mode,internlm2-base-7b-turbomind
cmmlu-agronomy,4c7f2c,accuracy,gen,27.81
cmmlu-anatomy,ea09bf,accuracy,gen,24.32
cmmlu-ancient_chinese,f7c97f,accuracy,gen,35.98
cmmlu-arts,dd77b8,accuracy,gen,21.88
cmmlu-astronomy,1e49db,accuracy,gen,26.67
cmmlu-business_ethics,dc78cb,accuracy,gen,26.32
cmmlu-chinese_civil_service_exam,1de82c,accuracy,gen,37.50
cmmlu-chinese_driving_rule,b8a42b,accuracy,gen,22.90
cmmlu-chinese_food_culture,2d568a,accuracy,gen,23.53
cmmlu-chinese_foreign_policy,dc2427,accuracy,gen,28.04
cmmlu-chinese_history,4cc7ed,accuracy,gen,44.89
cmmlu-chinese_literature,af3c41,accuracy,gen,29.41
cmmlu-chinese_teacher_qualification,87de11,accuracy,gen,26.26
cmmlu-clinical_knowledge,c55b1d,accuracy,gen,16.46
cmmlu-college_actuarial_science,d3c360,accuracy,gen,5.66
cmmlu-college_education,df8790,accuracy,gen,32.71
cmmlu-college_engineering_hydrology,673f23,accuracy,gen,33.96
cmmlu-college_law,524c3a,accuracy,gen,25.00
cmmlu-college_mathematics,e4ebad,accuracy,gen,18.10
cmmlu-college_medical_statistics,55af35,accuracy,gen,28.30
cmmlu-college_medicine,702f48,accuracy,gen,16.12
cmmlu-computer_science,637007,accuracy,gen,21.57
cmmlu-computer_security,932b6b,accuracy,gen,24.56
cmmlu-conceptual_physics,cfc077,accuracy,gen,20.41
cmmlu-construction_project_management,968a4a,accuracy,gen,26.62
cmmlu-economics,ddaf7c,accuracy,gen,27.67
cmmlu-education,c35963,accuracy,gen,22.70
cmmlu-electrical_engineering,70e98a,accuracy,gen,23.84
cmmlu-elementary_chinese,cbcd6a,accuracy,gen,31.75
cmmlu-elementary_commonsense,a67f37,accuracy,gen,31.82
cmmlu-elementary_information_and_technology,d34d2a,accuracy,gen,15.55
cmmlu-elementary_mathematics,a9d403,accuracy,gen,24.78
cmmlu-ethnology,31955f,accuracy,gen,25.93
cmmlu-food_science,741d8e,accuracy,gen,23.78
cmmlu-genetics,c326f7,accuracy,gen,26.14
cmmlu-global_facts,0a1236,accuracy,gen,23.49
cmmlu-high_school_biology,2be811,accuracy,gen,37.87
cmmlu-high_school_chemistry,d63c05,accuracy,gen,28.79
cmmlu-high_school_geography,5cd489,accuracy,gen,22.88
cmmlu-high_school_mathematics,6b2087,accuracy,gen,28.05
cmmlu-high_school_physics,3df353,accuracy,gen,7.27
cmmlu-high_school_politics,7a88d8,accuracy,gen,42.66
cmmlu-human_sexuality,54ac98,accuracy,gen,25.40
cmmlu-international_law,0f5d40,accuracy,gen,22.70
cmmlu-journalism,a4f6a0,accuracy,gen,16.28
cmmlu-jurisprudence,7843da,accuracy,gen,36.01
cmmlu-legal_and_moral_basis,f906b0,accuracy,gen,12.62
cmmlu-logical,15a71b,accuracy,gen,36.59
cmmlu-machine_learning,bc6ad4,accuracy,gen,18.85
cmmlu-management,e5e8db,accuracy,gen,21.43
cmmlu-marketing,8b4c18,accuracy,gen,21.67
cmmlu-marxist_theory,75eb79,accuracy,gen,22.22
cmmlu-modern_chinese,83a9b7,accuracy,gen,30.17
cmmlu-nutrition,adfff7,accuracy,gen,30.34
cmmlu-philosophy,75e22d,accuracy,gen,29.52
cmmlu-professional_accounting,0edc91,accuracy,gen,26.86
cmmlu-professional_law,d24af5,accuracy,gen,32.23
cmmlu-professional_medicine,134139,accuracy,gen,27.93
cmmlu-professional_psychology,ec920e,accuracy,gen,27.16
cmmlu-public_relations,70ee06,accuracy,gen,27.59
cmmlu-security_study,45f96f,accuracy,gen,25.93
cmmlu-sociology,485285,accuracy,gen,25.22
cmmlu-sports_science,838cfe,accuracy,gen,29.09
cmmlu-traditional_chinese_medicine,3bbf64,accuracy,gen,42.16
cmmlu-virology,8925bf,accuracy,gen,27.81
cmmlu-world_history,57c97c,accuracy,gen,33.54
cmmlu-world_religions,1d0f4b,accuracy,gen,26.88
cmmlu-humanities,-,naive_average,gen,29.57
cmmlu-stem,-,naive_average,gen,23.67
cmmlu-social-science,-,naive_average,gen,27.55
cmmlu-other,-,naive_average,gen,24.88
cmmlu-china-specific,-,naive_average,gen,31.97
cmmlu,-,naive_average,gen,26.36

cmmlu 指标只有26.36，观察到结果prediction中很多不会直接输出 选项，而是输出选项的答案。

### 重现问题 - 命令或脚本

如上

### 重现问题 - 错误信息

如上

### 其他信息

仅修改了 config文件的模型路径，改为了本地下载好的权重文件

以下代码修改以下prompt就正常了
https://github.com/open-compass/opencompass/blob/ae9efb73ad84086004a46a0aae83dfbc9905c966/configs/datasets/cmmlu/cmmlu_gen_c13365.py#L96

`答案是: {answer}` 改为 `答案是: {answer}\n`