Repository: modelscope/evalscope
Issue: 数据混合评测：KeyError: 'task_type'
Root cause: Validation Gap

## 自查清单

在提交 issue 之前，请确保您已完成以下步骤:
- [ ] 我已仔细阅读了[相关使用说明文档](https://evalscope.readthedocs.io/zh-cn/latest/get_started/parameters.html)
- [ ] 我已查看了[常见问题解答](https://evalscope.readthedocs.io/zh-cn/latest/get_started/faq.html)
- [ ] 我已搜索并查看了现有的 issues，确认这不是一个重复的问题

## 问题描述

请简要描述您遇到的问题。

## EvalScope 版本（必填）
v1.0

## 使用的工具
- [ ] Native / 原生框架
- [ ] Opencompass backend
- [ ] VLMEvalKit backend
- [ ] RAGEval backend
- [ ] Perf / 模型推理压测工具
- [ ] Arena / 竞技场模式

## 执行的代码或指令
task_cfg = TaskConfig(
    model='qwen2.5-14b',
    api_url='http://xxx:9082/alg-fc/v1',
    api_key='EMPTY',
    eval_type=EvalType.SERVICE,
    datasets=['data_collection'],
    dataset_args={'data_collection': {
        'local_path': 'outputs/weighted_mixed_data.jsonl'
    }},
)

run_task(task_cfg=task_cfg)

outputs/weighted_mixed_data.jsonl
{"index": 0, "prompt": {"input": [{"id": "629578bd", "content": "李白的职业是什么", "role": "user"}], "target": "诗人", "id": 3, "group_id": 3, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 1, "prompt": {"input": [{"id": "a56266a4", "content": "为什么北极见不到企鹅？", "role": "user"}], "target": "因为企鹅大多生活在南极", "id": 2, "group_id": 2, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 2, "prompt": {"input": [{"id": "ac5241c6", "content": "中国的首都是哪里？", "role": "user"}], "target": "中国的首都是北京", "id": 0, "group_id": 0, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 3, "prompt": {"input": [{"id": "ac029b7d", "content": "世界上最高的山是哪座山？", "role": "user"}], "target": "是珠穆朗玛峰", "id": 1, "group_id": 1, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
~
~

## 错误日志

Traceback (most recent call last):
  File "/home/alg/qdl/test.py", line 46, in <module>
    run_task(task_cfg=task_cfg)
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/run.py", line 28, in run_task
    return run_single_task(task_cfg, run_time)
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/run.py", line 41, in run_single_task
    result = evaluate_model(task_cfg, outputs)
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/run.py", line 143, in evaluate_model
    res_dict = evaluator.eval()
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/evaluator/evaluator.py", line 100, in eval
    subset_score = self.evaluate_subset(subset, dataset)
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/evaluator/evaluator.py", line 130, in evaluate_subset
    agg_scores = self.benchmark.aggregate_scores(sample_scores=sample_scores)
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/benchmarks/data_collection/data_collection_adapter.py", line 171, in aggregate_scores
    subset_report_df = aggregate_and_sort(df, ['task_type', 'metric', 'dataset_name', 'subset_name'])
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/evalscope/benchmarks/data_collection/data_collection_adapter.py", line 162, in aggregate_and_sort
    report_df = df.groupby(group_by_cols) \
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/pandas/core/frame.py", line 9190, in groupby
    return DataFrameGroupBy(
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1330, in __init__
    grouper, exclusions, obj = get_grouper(
  File "/data/anaconda3/envs/evalscope/lib/python3.10/site-packages/pandas/core/groupby/grouper.py", line 1043, in get_grouper
    raise KeyError(gpr)
KeyError: 'task_type'

## 运行环境

- 操作系统：
- Python版本：

## 其他信息

如果有其他相关信息，请在此处提供。


我这边测试没问题，你看看log里面有没有其他报错：

<img width="1086" height="668" alt="Image" src="https://github.com/user-attachments/assets/4fe76bac-6dd6-4799-af56-6011cc655700" />

outputs/weighted_mixed_data.jsonl
{"index": 0, "prompt": {"input": [{"id": "629578bd", "content": "李白的职业是什么", "role": "user"}], "target": "诗人", "id": 3, "group_id": 3, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 1, "prompt": {"input": [{"id": "a56266a4", "content": "为什么北极见不到企鹅？", "role": "user"}], "target": "因为企鹅大多生活在南极", "id": 2, "group_id": 2, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 2, "prompt": {"input": [{"id": "ac5241c6", "content": "中国的首都是哪里？", "role": "user"}], "target": "中国的首都是北京", "id": 0, "group_id": 0, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}
{"index": 3, "prompt": {"input": [{"id": "ac029b7d", "content": "世界上最高的山是哪座山？", "role": "user"}], "target": "是珠穆朗玛峰", "id": 1, "group_id": 1, "metadata": {}}, "tags": ["问答题"], "categories": ["推理能力"], "task_type": "问答", "weight": 1.0, "dataset_name": "general_qa", "subset_name": "default"}


数据集的格式对吗，这是任务信息
`{
    "model": "qwen2.5-14b-toolcall",
    "model_id": "qwen2.5-14b-toolcall",
    "model_args": {},
    "model_task": "text_generation",
    "chat_template": null,
    "datasets": [
        "data_collection"
    ],
    "dataset_args": {
        "data_collection": {
            "name": "data_collection",
            "dataset_id": "outputs/weighted_mixed_data.jsonl",
            "output_types": [
                "generation"
            ],
            "subset_list": [
                "default"
            ],
            "default_subset": "default",
            "few_shot_num": 0,
            "few_shot_random": false,
            "train_split": null,
            "eval_split": "test",
            "prompt_template": "",
            "few_shot_prompt_template": null,
            "system_prompt": null,
            "query_template": null,
            "pretty_name": null,
            "description": "Data collection",
            "tags": [],
            "filters": null,
            "metric_list": [
                "acc"
            ],
            "aggregation": "mean",
            "extra_params": {}
        }
    },
    "dataset_dir": "/home/alg/.cache/modelscope/hub/datasets",
    "dataset_hub": "modelscope",
    "repeats": 1,
    "generation_config": {
        "batch_size": 1,
        "max_tokens": 2048,
        "temperature": 0.0
    },
    "eval_type": "openai_api",
    "eval_backend": "Native",
    "eval_config": null,
    "limit": null,
    "eval_batch_size": 1,
    "use_cache": null,
    "rerun_review": false,
    "work_dir": "./outputs/20250903_182403",
    "ignore_errors": false,
    "debug": false,
    "dry_run": false,
    "seed": 42,
    "api_url": "http://xxx/alg-fc/v1",
    "timeout": null,
    "stream": null,
    "judge_strategy": "auto",
    "judge_worker_num": 1,
    "judge_model_args": {},
    "analysis_report": false
}`

<img width="1993" height="652" alt="Image" src="https://github.com/user-attachments/assets/6459128f-9ec2-42e7-8061-af388e90c562" />

数据格式没问题，我直接用你提供的这个几条jsonl数据集可以正常运行