Repository: open-compass/opencompass
Issue: [Bug] Unsupported operand types in OpenAISDK
Root cause: Environment Incompatibility

### 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

/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/__init__.py:17: UserWarning: Starting from v0.4.0, all AMOTIC configuration files currently located in `./configs/datasets`, `./configs/models`, and `./configs/summarizers` will be migrated to the `opencompass/configs/` package. Please update your configuration file paths accordingly.
  _warn_about_config_migration()
/bin/sh: 1: clang: not found
{'CUDA available': True,
 'CUDA_HOME': '/usr/local/cuda',
 'GCC': 'n/a',
 'GPU 0': 'NVIDIA RTX A6000',
 'MMEngine': '0.10.5',
 'MUSA available': False,
 'NVCC': 'Cuda compilation tools, release 12.6, V12.6.85',
 'OpenCV': '4.10.0',
 'PyTorch': '2.5.1+cu124',
 'PyTorch compiling details': 'PyTorch built with:\n'
                              '  - GCC 9.3\n'
                              '  - C++ Version: 201703\n'
                              '  - Intel(R) oneAPI Math Kernel Library Version '
                              '2024.2-Product Build 20240605 for Intel(R) 64 '
                              'architecture applications\n'
                              '  - Intel(R) MKL-DNN v3.5.3 (Git Hash '
                              '66f0cb9eb66affd2da3bf5f8d897376f04aae6af)\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 12.4\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_90,code=sm_90\n'
                              '  - CuDNN 90.1\n'
                              '  - Magma 2.6.1\n'
                              '  - Build settings: BLAS_INFO=mkl, '
                              'BUILD_TYPE=Release, CUDA_VERSION=12.4, '
                              'CUDNN_VERSION=9.1.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 -DLIBKINETO_NOXPUPTI=ON '
                              '-DUSE_FBGEMM -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-strict-overflow -Wno-strict-aliasing '
                              '-Wno-stringop-overflow -Wsuggest-override '
                              '-Wno-psabi -Wno-error=old-style-cast '
                              '-Wno-missing-braces -fdiagnostics-color=always '
                              '-faligned-new -Wno-unused-but-set-variable '
                              '-Wno-maybe-uninitialized -fno-math-errno '
                              '-fno-trapping-math -Werror=format '
                              '-Wno-stringop-overflow, LAPACK_INFO=mkl, '
                              'PERF_WITH_AVX=1, PERF_WITH_AVX2=1, '
                              'TORCH_VERSION=2.5.1, USE_CUDA=ON, USE_CUDNN=ON, '
                              'USE_CUSPARSELT=1, USE_EXCEPTION_PTR=1, '
                              'USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, '
                              'USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, '
                              'USE_NCCL=1, USE_NNPACK=ON, USE_OPENMP=ON, '
                              'USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, \n',
 'Python': '3.9.20 (main, Sep  9 2024, 22:13:21) [Clang 18.1.8 ]',
 'TorchVision': '0.20.1+cu124',
 'lmdeploy': '0.2.2',
 'numpy_random_seed': 2147483648,
 'opencompass': '0.3.6+',
 'sys.platform': 'linux',
 'transformers': '4.46.3'}

### Reproduces the problem - code/configuration sample

opencompass --datasets demo_gsm8k_chat_gen --hf-type chat --hf-path internlm/internlm2_5-1_8b-chat --dry-run

as indicated in demo

### Reproduces the problem - command or script

opencompass --datasets demo_gsm8k_chat_gen --hf-type chat --hf-path internlm/internlm2_5-1_8b-chat --dry-run

as indicated in demo

### Reproduces the problem - error message

data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/__init__.py:17: UserWarning: Starting from v0.4.0, all AMOTIC configuration files currently located in `./configs/datasets`, `./configs/models`, and `./configs/summarizers` will be migrated to the `opencompass/configs/` package. Please update your configuration file paths accordingly.
  _warn_about_config_migration()
Traceback (most recent call last):
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/bin/opencompass", line 5, in <module>
    from opencompass.cli.main import main
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/cli/main.py", line 16, in <module>
    from opencompass.utils.run import (fill_eval_cfg, fill_infer_cfg,
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/utils/run.py", line 9, in <module>
    from opencompass.datasets.custom import make_custom_dataset_config
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/datasets/__init__.py", line 1, in <module>
    from .advglue import *  # noqa: F401, F403
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/datasets/advglue.py", line 6, in <module>
    from opencompass.openicl.icl_evaluator import AccEvaluator
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/openicl/__init__.py", line 2, in <module>
    from .icl_evaluator import *  # noqa
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/openicl/icl_evaluator/__init__.py", line 1, in <module>
    from .icl_agent_evaluator import *  # noqa
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/openicl/icl_evaluator/icl_agent_evaluator.py", line 11, in <module>
    from opencompass.models import OpenAI
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/models/__init__.py", line 34, in <module>
    from .openai_api import OpenAI  # noqa: F401
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/models/openai_api.py", line 467, in <module>
    class OpenAISDK(OpenAI):
  File "/data/healthy-ml/scratch/maanas/opencompass/.venv/lib/python3.9/site-packages/opencompass/models/openai_api.py", line 476, in OpenAISDK
    key: str | List[str] = 'ENV',
TypeError: unsupported operand type(s) for |: 'type' and '_GenericAlias'

### Other information

_No response_

Hi @maanasharma5, the `str | List[str]` type hint syntax is only supported in python 3.10 or later. Try upgrading to python>=3.10 and try again.