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
This commit is contained in:
jinli.yl 2025-09-02 19:10:08 +08:00
parent 57a22d8da4
commit a4d8e5912d
2 changed files with 6 additions and 35 deletions

View file

@ -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%)** |
## 📚 相关资源

View file

@ -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
}