zhiminy/EvalEng huggingface dataset:
Repository: open-compass/opencompass
Issue: [Feature] Update the Lark Bot section of Useful Tools in the documentation

### Describe the feature

1. The Lark Bot section of Useful tools in the documentation is different in Chinese and English.
2. The contents seem to be out of date, because there are no files mentioned , such as `configs/secrets.py`, `configs/eval.py`, and `  _base_ = [
      'secrets.py',
      ...
  ]`

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!

I just found the Task Monitoring: Lark Bot section of TASK EXECUTION AND MONITORING in the documentation. And I successfully set up the lark bot according to the instructions. Please consider merging the Lark Bot section of Useful Tools and the Task Monitoring: Lark Bot section of TASK EXECUTION AND MONITORING.

Happy to see that the problem has been resolved. Thanks for the good suggestion, would you like to contribute a PR for this improvement?

> Happy to see that the problem has been resolved. Thanks for the good suggestion, would you like to contribute a PR for this improvement?

Sure! Thank you for inviting me to contribute.  I'd be happy to work on the suggested improvements and will prepare a PR soon.
Repository: open-compass/opencompass
Issue: Make NeedleBench available on HF
Root cause: Unimplemented Feature Gap

### Describe the feature

Hi there,

Congrats on releasing the NeedleBench dataset! Niels here from the open-source team at Hugging Face. I discovered your work through the paper page: https://huggingface.co/papers/2407.11963 (feel free to claim it if you have a HF account).

I was wondering whether you would be up for making your dataset available on the hub, such that people can do:

```python
from datasets import load_dataset

dataset = load_dataset("open-compass/needlebench")
```

? This would also ensure a dataset viewer, which allows people to easily discover and read the first few rows of the dataset in the browser, along with tags like "retrieval", "long-context" so that people can easily find it when filtering hf.co/datasets (filters are on the left).

See here for a guide: https://huggingface.co/docs/datasets/loading.

It could then also be linked to the paper page, as explained here: https://huggingface.co/docs/hub/en/datasets-cards#linking-a-paper.

Let me know if you need any help!

Cheers,

Niels
ML Engineer @ HF 🤗 

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!

Thanks for the great suggestion, we will update the dataset next week. 

Hi Niels, thank you very much for your valuable suggestion. I have added this feature in the latest PR #1364 . Feel free to reopen this issue if you have any further questions.
Repository: open-compass/opencompass
Issue: 不同数据集使用不同的batch_size大小加速推理[Feature] 
Root cause: Unimplemented Feature Gap

### Describe the feature

目前评测多个数据集时，如果不使用vllm，只能在模型测添加batch_size，但是有的数据集较长，有的较短，同样的batch_size可能会利用gpu不充分，如何针对数据集设置batch_size。

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!
Repository: open-compass/opencompass
Issue: [Feature] Support OpenBuddy
Root cause: Unimplemented Feature Gap

### Discussed in https://github.com/open-compass/opencompass/discussions/1347

<div type='discussions-op-text'>

<sup>Originally posted by **starplatinum3** July 22, 2024</sup>
求支持OpenBuddy
GitHub - OpenBuddy/OpenBuddy: Open Multilingual Chatbot for Everyone
https://github.com/OpenBuddy/OpenBuddy</div>
Repository: open-compass/opencompass
Issue: 在评测hunameval数据时，遇到一些问题，请帮忙看下；
Root cause: Environment Incompatibility

### 描述该错误

评测humaneval数据，推理完成，eval阶段出现下面异常，可能是哪里出了问题？
Traceback (most recent call last):
  File "/root/project/code/opencompass-3715be6/opencompass/tasks/openicl_eval.py", line 180, in <module>
    inferencer.run()
  File "/root/project/code/opencompass-3715be6/opencompass/tasks/openicl_eval.py", line 54, in run
    self._score()
  File "/root/project/code/opencompass-3715be6/opencompass/tasks/openicl_eval.py", line 121, in _score
    result = icl_evaluator.score(
  File "/root/project/code/opencompass-3715be6/opencompass/datasets/humaneval.py", line 36, in score
    score = self.eval(out_dir,
  File "/root/project/code/opencompass-3715be6/human-eval-master/human_eval/evaluation.py", line 51, in evaluate_functional_correctness
    problems = read_problems(problem_file)
  File "/root/project/code/opencompass-3715be6/human-eval-master/human_eval/data.py", line 12, in read_problems
    return {task["task_id"]: task for task in stream_jsonl(evalset_file)}
  File "/root/project/code/opencompass-3715be6/human-eval-master/human_eval/data.py", line 12, in <dictcomp>
    return {task["task_id"]: task for task in stream_jsonl(evalset_file)}
  File "/root/project/code/opencompass-3715be6/human-eval-master/human_eval/data.py", line 21, in stream_jsonl
    with open(filename, "rb") as gzfp:
FileNotFoundError: [Errno 2] No such file or directory: '/root/project/code/opencompass-3715be6/human-eval-master/human_eval/../data/HumanEval.jsonl.gz'

### 环境信息

python3.10
humanEval使用master分之

### 其他信息

_No response_

Please check whether you have uncomment some of the lines in human-eval repo.

https://github.com/InternLM/opencompass/blob/262ab794fb52084e4494c281210e652706ce1280/docs/zh_cn/get_started.md?plain=1#L35

> execution.py

感谢答复。58行的代码已经放开了。这个错误和之前那个错误好像不一样呢？说是找不到data/HumanEval.jsonl.gz文件。

It looks like the `human-eval` repo is not complete, maybe a manual download is needed:

https://github.com/openai/human-eval/blob/master/data/HumanEval.jsonl.gz

put it to `/root/project/code/opencompass-3715be6/human-eval-master/data/HumanEval.jsonl.gz`

> It looks like the `human-eval` repo is not complete, maybe a manual download is needed:
> 
> https://github.com/openai/human-eval/blob/master/data/HumanEval.jsonl.gz
> 
> put it to `/root/project/code/opencompass-3715be6/human-eval-master/data/HumanEval.jsonl.gz`

Yes, I made a rookie mistake. Thank you very much for the response.
Repository: open-compass/opencompass
Issue: [Feature] 直接在第三方脚本中启动评测
Root cause: Unimplemented Feature Gap

### 描述该功能

我已经在自己的脚本里有一个量化后的model实例了，我如何启动直接启动评测而不是重新在命令行中用python run.py方法加载model
就跟lm-eval支持的一样
![image](https://github.com/user-attachments/assets/a58ea413-557d-4e9f-a387-681582d1a05d)


### 是否希望自己实现该功能？

- [ ] 我希望自己来实现这一功能，并向 OpenCompass 贡献代码！
Repository: open-compass/opencompass
Issue: [Feature] 支持MultiPL-E数据集
Root cause: Unimplemented Feature Gap

### Describe the feature

目前看到这个多语言代码数据集在一些模型评测上有较多的提及，希望能够支持一下
https://github.com/nuprl/MultiPL-E

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!
Repository: open-compass/opencompass
Issue: What's the relationship between compassarena, compassbench, and creationbench?

### Describe the feature

Would you give a brief introduction about the relationship between compassarena, compassbench, and creationbench?

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!

If you are referring to the dataset, CompassArena was once our internal subjective test dataset, but it has been deprecated and replaced by CompassBench, which is also the subjective test dataset released to the public. CreationBench is a dataset being prepared for release to test the creation capabilities of models and is currently undergoing optimization and iteration. Additionally, CompassArena now refers to the User Voting Arena. For more information, see https://modelscope.cn/studios/opencompass/CompassArena.


Here is the official link to [OpenCompass CompassArena](https://opencompass.org.cn/arena).

Feel free to re-open if needed.
Repository: open-compass/opencompass
Issue: How to set temperature when use llm as judge?
Root cause: Documentation Deficiency

### Describe the feature

Do I need to set temperature = 0 when I try to use llm as judge. Otherwise, every time the score is different.

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!

Yes, in subjective evaluation, we often set temperature=1 when doing model inference, but set temerature=0 when use llm as judge

Feel free to re-open if needed.
Repository: open-compass/opencompass
Issue: [Feature] _set_model_kwargs_torch_dtype in _load_model will overide the torch_dtype in the config.json of any given huggingface models by default 
Root cause: Algorithmic Error

### Describe the feature

https://github.com/open-compass/opencompass/blob/52eccc4f0efd3ca6f272ae19efb2d7f6cc9c9dec/opencompass/models/huggingface_above_v4_33.py#L213

![image](https://github.com/user-attachments/assets/e80dd51a-dd3b-45a8-9899-7aa18d5801ca)

In most cases people who import any huggingface model by the argument --hf-path might think the "torch_dtype" in the config.json will take effect, but the "_load_model" function will always overide it with float16 by calling "_set_model_kwargs_torch_dtype" if not any line like "--model-kwargs torch_dtype='xxx'" is added to your command lines.

It would be better to check the "torch_dtype" in the config.json first.

### Will you implement it?

- [ ] I would like to implement this feature and create a PR!

Thanks, we will fix this bug recently.
Repository: open-compass/opencompass
Issue: [Bug] TurboMindModelwithChatTemplate中tm_model变量可能未初始化导致报错
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

`python tools/prompt_viewer.py gsm8k_llama3_8b_ins.py`


### Reproduces the problem - code/configuration sample

gsm8k_llama3_8b_ins.py
```
from mmengine.config import read_base
from opencompass.partitioners import NaivePartitioner, SizePartitioner
from opencompass.tasks import OpenICLInferTask, OpenICLEvalTask
from opencompass.runners import LocalRunner


with read_base():
    # 数学
    from ..datasets.gsm8k.gsm8k_gen import gsm8k_datasets as data
    from .model_select import models

datasets = [*data]

infer = dict(
    partitioner=dict(type=SizePartitioner, max_task_size=5000),
    runner=dict(
        type=LocalRunner,
        max_num_workers=4,
        task=dict(type=OpenICLInferTask)),
)

eval = dict(
    partitioner=dict(type=NaivePartitioner),
    runner=dict(
        type=LocalRunner,
        task=dict(type=OpenICLEvalTask),
        max_num_workers=16,
    )
)
from opencompass.models import TurboMindModelwithChatTemplate

models = [
    dict(
        type=TurboMindModelwithChatTemplate,
        abbr='llama-3-8b-instruct-turbomind',
        path='meta-llama/Meta-Llama-3-8B-Instruct',
        engine_config=dict(max_batch_size=16, tp=1),
        gen_config=dict(top_k=1, temperature=1e-6, top_p=0.9, max_new_tokens=1024),
        max_seq_len=7168,
        max_out_len=1024,
        batch_size=16,
        run_cfg=dict(num_gpus=1),
        stop_words=['
', '
'],
    )
]
```

### Reproduces the problem - command or script

在主目录执行命令：
`python tools/prompt_viewer.py gsm8k_llama3_8b_ins.py`
就会报错

### Reproduces the problem - error message

<img width="446" alt="IMG_6107" src="https://github.com/user-attachments/assets/2bfe6e0f-634c-46b3-802a-220c0419de5c">


### Other information

错误原因：turbomind_with_tf_above_v4_33.py文件第54到61行。如果tokenizer_only为True。导致tm_model无法被初始化，但是self.generators = [tm_model.create_instance() for i in range(concurrency)]调用了tm_model，导致报错。刚好prompt_viewer.py满足该条件。

Thanks for the report, we will add this promblem into our backlog. For prompt viewer, you can use the HF version model configuration.
Repository: open-compass/opencompass
Issue: [Feature] opencompass有计划支持CS-Bench数据集评测吗？
Root cause: Unimplemented Feature Gap

### Describe the feature

[Feature] opencompass有计划支持CS-Bench数据集评测吗？

### Will you implement it?

- [X] I would like to implement this feature and create a PR!

Thanks for your suggestion, I want to confirm the CS-Bench : https://github.com/csbench/csbench , right ?

> Thanks for your suggestion, I want to confirm the CS-Bench : https://github.com/csbench/csbench , right ?

是的，https://hub.opencompass.org.cn/dataset-detail/CS-Bench

Got it, we wil add this bench into our backlog.
Repository: open-compass/opencompass
Issue: [Bug] Webchat二维码过期了

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

Webchat二维码过期了

### Reproduces the problem - code/configuration sample

Webchat二维码过期了

### Reproduces the problem - command or script

Webchat二维码过期了

### Reproduces the problem - error message

Webchat二维码过期了

### Other information

Webchat二维码过期了

Thanks for the report. Fixed, feel free to re-open if needed.
Repository: open-compass/opencompass
Issue: 关于大语言模型公开学术榜单



想请问下，我看最新的CompassRank 评测榜单分为了大语言模型官方自建榜单和大语言模型公开学术榜单，公开学术榜单里面之前一些其他的公开评测集结果好像没有了，请问在哪里可以看到
这个结果对我们还是比较重要，我们集成评测集的结果都是参考opencompass的结果

We will upload all performance with latest toolkit and config recently. Stay tuned. If you want to refer the previous data, we will provide a json file this week.

> We will upload all performance with latest toolkit and config recently. Stay tuned. If you want to refer the previous data, we will provide a json file this week.

请问什么时候开源榜单的config呢？榜单和数据集的readme差距也比较大，见[issue](https://github.com/open-compass/opencompass/issues/1434)

> We will upload all performance with latest toolkit and config recently. Stay tuned. If you want to refer the previous data, we will provide a json file this week.

这个json file有提供吗
Repository: open-compass/opencompass
Issue: [Feature] 调用本地模型服务，如何修改配置
Root cause: Documentation Deficiency



我域内有机器部署了vllm 的 Qwen2-7b 的模型服务，我想调用该机器的模型服务，可以直接curl就能访问到服务，请问如何部署评测。



An openai-style API?

> An openai-style API?
no , is Qwen2-7b , deployed in vllm 


Please follow https://opencompass.readthedocs.io/zh-cn/latest/advanced_guides/accelerator_intro.html for more information. Feel free to re-open if needed.

> Please follow https://opencompass.readthedocs.io/zh-cn/latest/advanced_guides/accelerator_intro.html for more information. Feel free to re-open if needed.

我参考上面链接修改调用的api接口，每次执行结果不一样，有什么需要注意的地方吗
https://github.com/open-compass/opencompass/issues/1634
Repository: open-compass/opencompass
Issue: [Bug] accuracy error
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) 中尚未被修复。

### 问题类型

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

### 环境

准确率可能错了，我看json文件大部分都对了，但准确率只有36%
[ARC-e-rate.json](https://github.com/user-attachments/files/16517610/ARC-e-rate.json)

[ARC-e.json](https://github.com/user-attachments/files/16517611/ARC-e.json)


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

python run.py configs/eval_demo.py

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

python run.py configs/eval_demo.py

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

accuracy might error

### 其他信息

no

You can remove you result folder under your output folder and rerun your evaluation by using `python run.py configs/eval_demo.py --reuse --mode eval --dump-eval-details`. In this case, your prediction and final result after post process will be showed in details

What is your content in `eval_demo.py`?
I use the default config: `/opencompass/configs/datasets/ARC_e/ARC_e_gen.py`, it works just fine.
<img width="535" alt="image" src="https://github.com/user-attachments/assets/df73ded0-0835-42d8-957f-b7f1d2c602d5">
Repository: open-compass/opencompass
Issue: longbench_vcsum找不到data_files
Root cause: Configuration Error

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

conda create --name opencompass python=3.10 pytorch torchvision pytorch-cuda -c nvidia -c pytorch -y
conda activate opencompass
git clone https://github.com/open-compass/opencompass opencompass
cd opencompass
pip install -e .

### Reproduces the problem - code/configuration sample

python run.py --models hf_llama3dot1_8b_instruct  --datasets longbench_vcsum_gen --debug

### Reproduces the problem - command or script

python run.py --models hf_llama3dot1_8b_instruct  --datasets longbench_vcsum_gen --debug

### Reproduces the problem - error message

File "/home/ubuntu/opencompass/run.py", line 4, in <module>
[rank0]:     main()
[rank0]:   File "/home/ubuntu/opencompass/opencompass/cli/main.py", line 308, in main
[rank0]:     runner(tasks)
[rank0]:   File "/home/ubuntu/opencompass/opencompass/runners/base.py", line 38, in __call__
[rank0]:     status = self.launch(tasks)
[rank0]:   File "/home/ubuntu/opencompass/opencompass/runners/local.py", line 123, in launch
[rank0]:     task.run(cur_model=getattr(self, 'cur_model',
[rank0]:   File "/home/ubuntu/opencompass/opencompass/tasks/openicl_infer.py", line 79, in run
[rank0]:     self.dataset = build_dataset_from_cfg(self.dataset_cfg)
[rank0]:   File "/home/ubuntu/opencompass/opencompass/utils/build.py", line 13, in build_dataset_from_cfg
[rank0]:     return LOAD_DATASET.build(dataset_cfg)
[rank0]:   File "/home/ubuntu/miniconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/registry/registry.py", line 570, in build
[rank0]:     return self.build_func(cfg, *args, **kwargs, registry=self)
[rank0]:   File "/home/ubuntu/miniconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
[rank0]:     obj = obj_cls(**args)  # type: ignore
[rank0]:   File "/home/ubuntu/opencompass/opencompass/datasets/base.py", line 12, in __init__
[rank0]:     self.dataset = self.load(**kwargs)
[rank0]:   File "/home/ubuntu/opencompass/opencompass/datasets/longbench/longbench_vcsum.py", line 14, in load
[rank0]:     kwargs['data_files'] = get_data_path(kwargs['data_files'],
[rank0]: KeyError: 'data_files'

### Other information

找不到longbench_vcsum对应的data_files。

Thanks for the report, we will check this error.
Repository: open-compass/opencompass
Issue: [Bug] commonsenseqa_gen 数据集测试时，显示OSError: We couldn't connect to 'https://huggingface.co' to load this file
Root cause: Environment Incompatibility

### 先决条件

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

### 问题类型

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

### 环境

--datasets commonsenseqa_gen --hf-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/ --tokenizer-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/  --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='cpu' --max-seq-len 1024 --max-out-len 16 --batch-size 1 --num-gpus 0 --debug

其他的数据集正常

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

--datasets commonsenseqa_gen --hf-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/ --tokenizer-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/  --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='cpu' --max-seq-len 1024 --max-out-len 16 --batch-size 1 --num-gpus 0 --debug

其他的数据集正常

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

--datasets commonsenseqa_gen --hf-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/ --tokenizer-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/  --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='cpu' --max-seq-len 1024 --max-out-len 16 --batch-size 1 --num-gpus 0 --debug

其他的数据集正常

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

--datasets commonsenseqa_gen --hf-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/ --tokenizer-path llm_mode_debug/Meta-Llama-3.1-8B-Instruct/  --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='cpu' --max-seq-len 1024 --max-out-len 16 --batch-size 1 --num-gpus 0 --debug

其他的数据集正常

### 其他信息

_No response_

Please provide your log and opencompass version so that we can reproduce the problem on our side

You can now download commonsenseqa dataset via modelscope
```
pip install modelscope[framework]
export DATASET_SOURCE=ModelScope
```

Feel free to re-open if needed.
Repository: open-compass/opencompass
Issue: [Bug] The conflict between `datasets>=2.20.0` and `pandas<2.0.0` 
Root cause: External Dependency Breakage

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

Refer to following code snippet:

Consider of the function `datasets.packaged_modules.json.json.Json._generate_tables` in `datasets` :

```python

# for datasets v2.20.0

try:
    with open(
        file, encoding=self.config.encoding, errors=self.config.encoding_errors
    ) as f:
        df = pd.read_json(f, dtype_backend="pyarrow")
except ValueError:
    logger.error(f"Failed to load JSON from file '{file}' with error {type(e)}: {e}")
    raise e

# =================================================================================

for datasets v2.18.0

try:
    with open(
        file, encoding=self.config.encoding, errors=self.config.encoding_errors
    ) as f:
        dataset = json.load(f)
except json.JSONDecodeError:
    logger.error(f"Failed to read file '{file}' with error {type(e)}: {e}")
    raise e

```

More specific, consider of this usage for `datasets==2.20.0`:  
The `pandas<2.0.0` does not support the usage:  `pd.read_json(f, dtype_backend="pyarrow")`, 

Can you remove the restriction for `pandas<2.0.0` in the runtime requirements ? or set datasets < 2.20.0


### Reproduces the problem - code/configuration sample

none

### Reproduces the problem - command or script

none

### Reproduces the problem - error message

none

### Other information

_No response_

Thanks for the report and we will fix this issue soon.

`pandas==1.5.3` is two years old. Maybe we should consider supporting a newer version to prevent further conflicts down the line.
Repository: open-compass/opencompass
Issue: [Bug] The mmengine does not support python3.11 or above 
Root cause: External Dependency Breakage

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

For python3.11 or above, the `mmengine` cannot work and report runtime error when loading config file


### Reproduces the problem - code/configuration sample

none

### Reproduces the problem - command or script

none

### Reproduces the problem - error message

none

### Other information

_No response_

Same error when using `pyext` dependency

参考 https://github.com/refi64/PyExt/pull/3

ok thx !