From a4d8e5912df3acf520586d7614027de1514756f9 Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Tue, 2 Sep 2025 19:10:08 +0800 Subject: [PATCH] docs(README): update ReMe results table and remove unused code - Update the ReMe results table in README_ZH.md for better readability - Remove unused and outdated code in trajectory_preprocess_op.py --- README_ZH.md | 8 ++--- .../summary/task/trajectory_preprocess_op.py | 33 ++----------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index 08a6809b..5ff48cff 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -229,10 +229,10 @@ Pass@K 衡量的是在生成的 K 个样本中,至少有一个成功完成任 我们在 BFCL-V3 multi-turn-base (随机划分50train/150val) 上使用 qwen3-8b 测试 ReMe: -| 方法 | pass@1 | pass@2 | pass@4 | -|---------------------|-----------|-------------|-----------| -| 不使用 ReMe (baseline) | 0.2472 | 0.2733 | 0.2922 | -| **使用 ReMe** | 0.3061 **(+5.89%)** | 0.3500 **(+7.67%)** | 0.3888 **(+9.66%)** | +| 方法 | pass@1 | pass@2 | pass@4 | +|--------------|---------------------|---------------------|---------------------| +| without Reme | 0.2472 | 0.2733 | 0.2922 | +| with Reme | 0.3061 **(+5.89%)** | 0.3500 **(+7.67%)** | 0.3888 **(+9.66%)** | ## 📚 相关资源 diff --git a/reme_ai/summary/task/trajectory_preprocess_op.py b/reme_ai/summary/task/trajectory_preprocess_op.py index 72d41431..501abbd1 100644 --- a/reme_ai/summary/task/trajectory_preprocess_op.py +++ b/reme_ai/summary/task/trajectory_preprocess_op.py @@ -1,4 +1,3 @@ -import json from typing import List, Dict from flowllm import C, BaseOp @@ -14,15 +13,7 @@ class TrajectoryPreprocessOp(BaseOp): def execute(self): """Preprocess trajectories: validate and classify""" trajectories: list = self.context.get("trajectories", []) - # trajectories: List[Trajectory] = [Trajectory(**x) if isinstance(x, dict) else x for x in trajectories] - new_trajectories: List[Trajectory] = [] - for x in trajectories: - if isinstance(x, dict): - x["messages"] = self._modify_tool_calls(x["messages"]) - new_trajectories.append(Trajectory(**x)) - else: - new_trajectories.append(x) - trajectories = new_trajectories + trajectories: List[Trajectory] = [Trajectory(**x) if isinstance(x, dict) else x for x in trajectories] # Classify trajectories classified = self._classify_trajectories(trajectories) @@ -53,24 +44,4 @@ class TrajectoryPreprocessOp(BaseOp): 'success': success_trajectories, 'failure': failure_trajectories, 'all': trajectories - } - - def _modify_tool_calls(self, messages: List[Dict]) -> List[Dict]: - new_messages = [] - - for msg in messages: - if 'tool_calls' in msg: - processed_tool_calls = [] - for tool_call in msg['tool_calls']: - tool_type = tool_call.get("type", "function") - nested_data = tool_call.get(tool_type, {}) - tool_call.update({ - "arguments": json.loads(nested_data.get("arguments", "")), - "name": nested_data.get("name", "") - }) - tool_call.pop(tool_type) - processed_tool_calls.append(tool_call) - msg['tool_calls'] = processed_tool_calls - new_messages.append(msg) - - return new_messages \ No newline at end of file + } \ No newline at end of file