Repository: open-compass/opencompass
Issue: [Bug] 使用提示词攻击，出现导入模块失败
Root cause: Validation Gap

### Prerequisite

- [x] I have searched [Issues](https://github.com/open-compass/opencompass/issues/) and [Discussions](https://github.com/open-compass/opencompass/discussions) but cannot get the expected help.
- [x] The bug has not been fixed in the [latest version](https://github.com/open-compass/opencompass).

### Type

I'm evaluating with the officially supported tasks/models/datasets.

### Environment

{'CUDA available': False,
 'GCC': 'n/a',
 'MMEngine': '0.10.5',
 'MSVC': '用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.42.34436 版',
 'MUSA available': False,
 'OpenCV': '4.10.0',
 'PyTorch': '2.2.0+cpu',
 'PyTorch compiling details': 'PyTorch built with:\n'
                              '  - C++ Version: 201703\n'
                              '  - MSVC 192930151\n'
                              '  - Intel(R) Math Kernel Library Version '
                              '2020.0.2 Product Build 20200624 for Intel(R) 64 '
                              'architecture applications\n'
                              '  - Intel(R) MKL-DNN v3.3.2 (Git Hash '
                              '2dc95a2ad0841e29db8b22fbccaf3e5da7992b01)\n'
                              '  - OpenMP 2019\n'
                              '  - LAPACK is enabled (usually provided by '
                              'MKL)\n'
                              '  - CPU capability usage: AVX2\n'
                              '  - Build settings: BLAS_INFO=mkl, '
                              'BUILD_TYPE=Release, '
                              'CXX_COMPILER=C:/actions-runner/_work/pytorch/pytorch/builder/windows/tmp_bin/sccache-cl.exe, '
                              'CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc '
                              '/Zc:__cplusplus /bigobj /FS /utf-8 '
                              '-DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO '
                              '-DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER '
                              '-DUSE_FBGEMM -DUSE_XNNPACK '
                              '-DSYMBOLICATE_MOBILE_DEBUG_HANDLE /wd4624 '
                              '/wd4068 /wd4067 /wd4267 /wd4661 /wd4717 /wd4244 '
                              '/wd4804 /wd4273, LAPACK_INFO=mkl, '
                              'PERF_WITH_AVX=1, PERF_WITH_AVX2=1, '
                              'PERF_WITH_AVX512=1, TORCH_VERSION=2.2.0, '
                              'USE_CUDA=0, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, '
                              'USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, '
                              'USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, '
                              'USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF, '
                              'USE_ROCM_KERNEL_ASSERT=OFF, \n',
 'Python': '3.10.16 | packaged by Anaconda, Inc. | (main, Dec 11 2024, '
           '16:19:12) [MSC v.1929 64 bit (AMD64)]',
 'TorchVision': '0.17.0+cpu',
 'lmdeploy': "not installed:No module named 'lmdeploy'",
 'numpy_random_seed': 2147483648,
 'opencompass': '0.3.9+7f2aeef',
 'sys.platform': 'win32',
 'transformers': '4.38.0'}


### Reproduces the problem - code/configuration sample

使用提示词攻击，已安装环境，
textattack                         0.3.8
promptbench                   0.0.4
运行过程中出现导入以下模块报错，是promptbench版本不对吗
from config import LABEL_SET
from prompt_attack.attack import create_attack
from prompt_attack.goal_function import PromptGoalFunction


### Reproduces the problem - command or script


Namespace(config='C:/Users\\PycharmProjects\\OpenCompass_Project\\opencompass\\configs\\eval_attack.py', slurm=False, dlc=False, models=None, datasets=None, summarizer=None, debug=True, dry_run=False, accelerator=None, mode='infer', reuse=None, work_dir='C:/Users\\PycharmProjects\\OpenCompass_Project\\opencompass\\Test_case\\output', config_dir='configs', lark=False, max_num_workers=4, max_workers_per_gpu=0, retry=2, dump_eval_details=False, dump_extract_rate=False, partition=None, quotatype=None, qos=None, aliyun_cfg='~/.aliyun.cfg', hf_type='chat', hf_path=None, model_kwargs={}, tokenizer_path=None, tokenizer_kwargs={}, peft_path=None, peft_kwargs={}, generation_kwargs={}, max_seq_len=None, max_out_len=256, min_out_len=1, batch_size=8, num_gpus=None, hf_num_gpus=0, pad_token_id=None, stop_words=[], custom_dataset_path=None, custom_dataset_meta_path=None, custom_dataset_data_type=None, custom_dataset_infer_method=None)

### Reproduces the problem - error message


Traceback (most recent call last):
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\Test_case\run_api.py", line 269, in <module>
    main(args)
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\Test_case\run_api.py", line 164, in main
    runner(tasks)
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\opencompass\runners\base.py", line 38, in __call__
    status = self.launch(tasks)
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\opencompass\runners\local.py", line 136, in launch
    task.run()
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\opencompass\tasks\openicl_attack.py", line 89, in run
    self._inference()
  File "C:\Users\PycharmProjects\OpenCompass_Project\opencompass\opencompass\tasks\openicl_attack.py", line 126, in _inference
    from config import LABEL_SET
ModuleNotFoundError: No module named 'config'

### Other information

_No response_